Class: Cloudflair::Analytics

Inherits:
Object
  • Object
show all
Includes:
Communication
Defined in:
lib/cloudflair/api/zone/analytics.rb

Instance Method Summary collapse

Methods included from Communication

#connection, #hash_to_object, #response

Constructor Details

#initialize(zone_id) ⇒ Analytics

Returns a new instance of Analytics.



9
10
11
# File 'lib/cloudflair/api/zone/analytics.rb', line 9

def initialize(zone_id)
  @path = "zones/#{zone_id}/analytics"
end

Instance Method Details

#colos(filter = {}) ⇒ Object



19
20
21
22
23
24
25
# File 'lib/cloudflair/api/zone/analytics.rb', line 19

def colos(filter = {})
  raw_response = connection.get "#{@path}/colos", filter
  parsed_responses = response raw_response
  parsed_responses.map do |parsed_response|
    hash_to_object parsed_response
  end
end

#dashboard(filter = {}) ⇒ Object



13
14
15
16
17
# File 'lib/cloudflair/api/zone/analytics.rb', line 13

def dashboard(filter = {})
  raw_response = connection.get "#{@path}/dashboard", filter
  parsed_response = response raw_response
  hash_to_object parsed_response
end