Class: EngineyardAPI::EyAPI

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/engineyard-api/ey_api.rb

Overview

Actually communicates with API.

Instance Method Summary collapse

Constructor Details

#initialize(key = $options[:key]) ⇒ EyAPI

:nodoc:



11
12
13
14
# File 'lib/engineyard-api/ey_api.rb', line 11

def initialize(key = $options[:key]) # :nodoc:
  @api_key = key

end

Instance Method Details

#get(path) ⇒ Object

:nodoc:



16
17
18
# File 'lib/engineyard-api/ey_api.rb', line 16

def get(path) # :nodoc:
  self.class.get(path, :headers => { 'X-EY-Cloud-Token' => @api_key })
end

#post(path, data) ⇒ Object

:nodoc:



20
21
22
# File 'lib/engineyard-api/ey_api.rb', line 20

def post(path,data) # :nodoc:
  self.class.post(path,data.merge(:headers=> { 'X-EY-Cloud-Token' => @api_key}))
end

#put(path, data = {}) ⇒ Object

:nodoc:



23
24
25
# File 'lib/engineyard-api/ey_api.rb', line 23

def put(path,data={}) # :nodoc:
  self.class.put(path,data.merge(:headers => { 'X-EY-Cloud-Token' => @api_key}))
end