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.
-
#initialisation_options ⇒ Object
Returns the value of attribute initialisation_options.
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
11 12 13 14 15 16 17 18 19 |
# File 'lib/vertebrae/api.rb', line 11 def initialize(={}, &block) self. = = .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.
7 8 9 |
# File 'lib/vertebrae/api.rb', line 7 def connection @connection end |
#initialisation_options ⇒ Object
Returns the value of attribute initialisation_options.
7 8 9 |
# File 'lib/vertebrae/api.rb', line 7 def @initialisation_options end |
Instance Method Details
#default_options ⇒ Object
24 25 26 |
# File 'lib/vertebrae/api.rb', line 24 def {} end |
#setup ⇒ Object
21 22 |
# File 'lib/vertebrae/api.rb', line 21 def setup end |
#yield_or_eval(&block) ⇒ Object
28 29 30 31 |
# File 'lib/vertebrae/api.rb', line 28 def yield_or_eval(&block) return unless block block.arity > 0 ? yield(self) : self.instance_eval(&block) end |