Class: Headsail::API
- Inherits:
-
Object
- Object
- Headsail::API
- Defined in:
- lib/headsail/api.rb
Instance Attribute Summary collapse
-
#method ⇒ Object
readonly
Returns the value of attribute method.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#oauth ⇒ Object
readonly
Returns the value of attribute oauth.
-
#timer ⇒ Object
readonly
Returns the value of attribute timer.
-
#uri ⇒ Object
readonly
Returns the value of attribute uri.
Instance Method Summary collapse
-
#initialize(config) ⇒ API
constructor
A new instance of API.
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
#method ⇒ Object (readonly)
Returns the value of attribute method.
3 4 5 |
# File 'lib/headsail/api.rb', line 3 def method @method end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/headsail/api.rb', line 3 def name @name end |
#oauth ⇒ Object (readonly)
Returns the value of attribute oauth.
3 4 5 |
# File 'lib/headsail/api.rb', line 3 def oauth @oauth end |
#timer ⇒ Object (readonly)
Returns the value of attribute timer.
3 4 5 |
# File 'lib/headsail/api.rb', line 3 def timer @timer end |
#uri ⇒ Object (readonly)
Returns the value of attribute uri.
3 4 5 |
# File 'lib/headsail/api.rb', line 3 def uri @uri end |