Class: Sorenson::Services::Metric
- Inherits:
-
Base
show all
- Defined in:
- lib/sorenson/services/metric.rb
Class Method Summary
collapse
Methods inherited from Base
delete_from, get_from, host, login_no_resource, parse_response, post_to, put_to, verify_account_settings
Class Method Details
.all(offset = nil, quantity = nil) ⇒ Object
4
5
6
7
8
|
# File 'lib/sorenson/services/metric.rb', line 4
def self.all(offset = nil, quantity = nil)
get_from("/metrics").collect do |event|
Event.new(event)
end
end
|
.storage_used(start_date = nil, end_date = nil) ⇒ Object
14
15
16
17
18
|
# File 'lib/sorenson/services/metric.rb', line 14
def self.storage_used(start_date = nil, end_date = nil)
options = {}
options.merge(:start_date => start_date, :end_date => end_date) if start_date && end_date
get_from("/metrics/storage", options)['storage_used']
end
|
.total_plays ⇒ Object
10
11
12
|
# File 'lib/sorenson/services/metric.rb', line 10
def self.total_plays
get_from("/metrics/total_plays")['total_plays'].to_i
end
|