Class: SmoothOperator::HttpHandlers::Typhoeus::ORM
- Inherits:
-
Object
- Object
- SmoothOperator::HttpHandlers::Typhoeus::ORM
- Defined in:
- lib/smooth_operator/http_handlers/typhoeus/orm.rb
Instance Attribute Summary collapse
-
#object_class ⇒ Object
readonly
Returns the value of attribute object_class.
Instance Method Summary collapse
-
#initialize(object_class) ⇒ ORM
constructor
A new instance of ORM.
- #make_the_call(http_verb, options, relative_path, &block) ⇒ Object
Constructor Details
#initialize(object_class) ⇒ ORM
Returns a new instance of ORM.
9 10 11 |
# File 'lib/smooth_operator/http_handlers/typhoeus/orm.rb', line 9 def initialize(object_class) @object_class = object_class end |
Instance Attribute Details
#object_class ⇒ Object (readonly)
Returns the value of attribute object_class.
7 8 9 |
# File 'lib/smooth_operator/http_handlers/typhoeus/orm.rb', line 7 def object_class @object_class end |
Instance Method Details
#make_the_call(http_verb, options, relative_path, &block) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/smooth_operator/http_handlers/typhoeus/orm.rb', line 13 def make_the_call(http_verb, , relative_path, &block) injected_hydra = [:hydra] hydra = injected_hydra || ::Typhoeus::Hydra::hydra [:hydra] = hydra remote_call = @object_class.make_the_call(http_verb, relative_path, ) remote_call.request.on_complete do |typhoeus_response| remote_call.raw_response = typhoeus_response yield(remote_call) end hydra.run if injected_hydra.blank? remote_call end |