Class: Itch::Purchases

Inherits:
Object
  • Object
show all
Includes:
Request, RequireAuth, SimpleInspect
Defined in:
lib/itch/purchases.rb

Overview

Return purchase history and history by date

Instance Method Summary collapse

Methods included from Request

#validate_response

Methods included from SimpleInspect

#exclude_inspection, #inspect, #pretty_print_instance_variables

Methods included from RequireAuth

#require_auth, #with_login

Constructor Details

#initialize(agent) ⇒ Purchases

Returns a new instance of Purchases.



15
16
17
# File 'lib/itch/purchases.rb', line 15

def initialize(agent)
  @agent = agent
end

Instance Method Details

#historyObject



27
28
29
# File 'lib/itch/purchases.rb', line 27

def history
  fetch_csv Itch::URL::PURCHASES_CSV
end

#history_by_month(month, year) ⇒ Object



19
20
21
# File 'lib/itch/purchases.rb', line 19

def history_by_month(month, year)
  fetch_csv format(Itch::URL::MONTH_PURCHASES_CSV, month: month, year: year)
end

#history_by_year(year) ⇒ Object



23
24
25
# File 'lib/itch/purchases.rb', line 23

def history_by_year(year)
  fetch_csv format(Itch::URL::YEAR_PURCHASES_CSV, year: year)
end