class Rowling::Rank

Attributes

book_list_api_url[RW]
date[RW]
rank[RW]

Public Class Methods

new(response) click to toggle source
# File lib/rowling/rank.rb, line 4
def initialize(response)
  self.date = Rowling::Rank.parse_rank_date(response["BookListDate"])
  self.rank = response["Rank"]
  self.book_list_api_url = response["BookListDate"]["BookListAPIUrl"]
end
parse_rank_date(date_response) click to toggle source
# File lib/rowling/rank.rb, line 12
def self.parse_rank_date(date_response)
  Date.new(date_response["Year"].to_i, date_response["Month"].to_i, date_response["Date"].to_i)
end