Class: Xively::Client

Inherits:
Object show all
Includes:
HTTParty
Defined in:
lib/xively-rb/client.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_key) ⇒ Client

Returns a new instance of Client.



13
14
15
# File 'lib/xively-rb/client.rb', line 13

def initialize(api_key)
  @api_key = api_key
end

Instance Attribute Details

#api_keyObject

Returns the value of attribute api_key.



7
8
9
# File 'lib/xively-rb/client.rb', line 7

def api_key
  @api_key
end

Class Method Details

.user_agentObject



9
10
11
# File 'lib/xively-rb/client.rb', line 9

def self.user_agent
  "xively-rb/#{Xively::VERSION}"
end

Instance Method Details

#delete(url, options = {}) ⇒ Object



21
22
23
# File 'lib/xively-rb/client.rb', line 21

def delete(url, options = {})
  self.class.delete(url, parse_options(options))
end

#get(url, options = {}) ⇒ Object



17
18
19
# File 'lib/xively-rb/client.rb', line 17

def get(url, options = {})
  self.class.get(url, parse_options(options))
end

#post(url, options = {}) ⇒ Object



29
30
31
# File 'lib/xively-rb/client.rb', line 29

def post(url, options = {})
  self.class.post(url, parse_options(options))
end

#put(url, options = {}) ⇒ Object



25
26
27
# File 'lib/xively-rb/client.rb', line 25

def put(url, options = {})
  self.class.put(url, parse_options(options))
end