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.



7
8
9
# File 'lib/cloudflair/api/zone/analytics.rb', line 7

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

Instance Method Details

#colos(filter = {}) ⇒ Object



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

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



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

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