Class: Vertebrae::API
Constant Summary
Constants included from Request
Request::METHODS, Request::METHODS_WITH_BODIES
Instance Attribute Summary collapse
-
#connection ⇒ Object
Returns the value of attribute connection.
Instance Method Summary collapse
- #default_options ⇒ Object
-
#initialize(options = {}, &block) ⇒ API
constructor
Create new API.
- #setup ⇒ Object
- #yield_or_eval(&block) ⇒ Object
Methods included from Request
#delete_request, #get_request, #patch_request, #post_request, #put_request, #request
Constructor Details
#initialize(options = {}, &block) ⇒ API
Create new API
9 10 11 12 13 14 15 16 |
# File 'lib/api.rb', line 9 def initialize(={}, &block) .merge!() yield_or_eval(&block) if block_given? self.connection = Connection.new() self.connection.configuration.process_basic_auth([:basic_auth]) setup end |
Instance Attribute Details
#connection ⇒ Object
Returns the value of attribute connection.
5 6 7 |
# File 'lib/api.rb', line 5 def connection @connection end |
Instance Method Details
#default_options ⇒ Object
21 22 23 |
# File 'lib/api.rb', line 21 def {} end |
#setup ⇒ Object
18 19 |
# File 'lib/api.rb', line 18 def setup end |
#yield_or_eval(&block) ⇒ Object
25 26 27 28 |
# File 'lib/api.rb', line 25 def yield_or_eval(&block) return unless block block.arity > 0 ? yield(self) : self.instance_eval(&block) end |