Class: Headsail::API

Inherits:
Object
  • Object
show all
Defined in:
lib/headsail/api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ API

Returns a new instance of API.



5
6
7
8
9
10
11
12
13
# File 'lib/headsail/api.rb', line 5

def initialize(config)
  @name = config['name']
  @timer = config['timer'].to_i
  @oauth = config['oauth']
  @method = config['request']['method']
  @uri = build_uri(config['request'])
rescue
  Headsail.err('Improper API YAML format.', :exit)
end

Instance Attribute Details

#methodObject (readonly)

Returns the value of attribute method.



3
4
5
# File 'lib/headsail/api.rb', line 3

def method
  @method
end

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/headsail/api.rb', line 3

def name
  @name
end

#oauthObject (readonly)

Returns the value of attribute oauth.



3
4
5
# File 'lib/headsail/api.rb', line 3

def oauth
  @oauth
end

#timerObject (readonly)

Returns the value of attribute timer.



3
4
5
# File 'lib/headsail/api.rb', line 3

def timer
  @timer
end

#uriObject (readonly)

Returns the value of attribute uri.



3
4
5
# File 'lib/headsail/api.rb', line 3

def uri
  @uri
end