Class: Api2Convert::Resource::Stats

Inherits:
Object
  • Object
show all
Defined in:
lib/api2convert/resource/stats.rb

Overview

API usage statistics. The response shape is free-form (returned as-is).

filter is either an API key to scope to, or "all".

Instance Method Summary collapse

Constructor Details

#initialize(transport) ⇒ Stats

Returns a new instance of Stats.



9
10
11
# File 'lib/api2convert/resource/stats.rb', line 9

def initialize(transport)
  @transport = transport
end

Instance Method Details

#day(day, filter = "all") ⇒ Object

day format yyyy-mm-dd.



14
15
16
# File 'lib/api2convert/resource/stats.rb', line 14

def day(day, filter = "all")
  @transport.request("GET", "/stats/day/#{seg(day)}/#{seg(filter)}")
end

#month(month, filter = "all") ⇒ Object

month format yyyy-mm.



19
20
21
# File 'lib/api2convert/resource/stats.rb', line 19

def month(month, filter = "all")
  @transport.request("GET", "/stats/month/#{seg(month)}/#{seg(filter)}")
end

#year(year, filter = "all") ⇒ Object

year format yyyy.



24
25
26
# File 'lib/api2convert/resource/stats.rb', line 24

def year(year, filter = "all")
  @transport.request("GET", "/stats/year/#{seg(year)}/#{seg(filter)}")
end