Class: Eisenhower::Client

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/eisenhower/client.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#oauth_tokenObject

Returns the value of attribute oauth_token.



3
4
5
# File 'lib/eisenhower/client.rb', line 3

def oauth_token
  @oauth_token
end

Class Method Details

.fetch(path, options = {}) ⇒ Object



9
10
11
12
# File 'lib/eisenhower/client.rb', line 9

def self.fetch(path, options={})
  options.merge!({:default_params => {:oauth_token=> Eisenhower.oauth_token}})
  get(path, options)
end

.get_and_parse(path, options = {}) ⇒ Object



14
15
16
17
# File 'lib/eisenhower/client.rb', line 14

def self.get_and_parse(path, options={})
  getter = fetch(path, options)
  return Crack::JSON.parse(getter.body)["response"] 
end