Class: Cloudflair::Railguns

Inherits:
Object
  • Object
show all
Includes:
Entity
Defined in:
lib/cloudflair/api/railguns.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Entity

#data=, #delete, included, #method_missing, #patch, #reload, #respond_to_missing?, #revert, #update

Methods included from Communication

#connection, #hash_to_object, #response

Constructor Details

#initialize(railgun_id) ⇒ Railguns

Returns a new instance of Railguns.



14
15
16
# File 'lib/cloudflair/api/railguns.rb', line 14

def initialize(railgun_id)
  @railgun_id = railgun_id
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Cloudflair::Entity

Instance Attribute Details

#railgun_idObject (readonly)

Returns the value of attribute railgun_id.



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

def railgun_id
  @railgun_id
end

Instance Method Details

#zonesObject



18
19
20
21
22
23
24
# File 'lib/cloudflair/api/railguns.rb', line 18

def zones
  raw_response = connection.get "#{path}/zones"
  parsed_responses = response raw_response
  parsed_responses.map do |parsed_response|
    hash_to_object parsed_response
  end
end