Class: Callapi::Call::Base
- Inherits:
-
Object
- Object
- Callapi::Call::Base
- Extended by:
- Forwardable, Memoist
- Defined in:
- lib/callapi/call/base.rb
Class Method Summary collapse
- .response_parser ⇒ Object
- .response_parser=(response_parser) ⇒ Object
- .strategy ⇒ Object
- .strategy=(strategy) ⇒ Object
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ Base
constructor
A new instance of Base.
- #reload ⇒ Object
- #request_metadata ⇒ Object
- #response ⇒ Object
- #response_parser ⇒ Object
- #strategy ⇒ Object
Constructor Details
#initialize(params = {}) ⇒ Base
Returns a new instance of Base.
15 16 17 |
# File 'lib/callapi/call/base.rb', line 15 def initialize(params = {}) add_params(params) end |
Class Method Details
.response_parser ⇒ Object
48 49 50 |
# File 'lib/callapi/call/base.rb', line 48 def self.response_parser @response_parser end |
.response_parser=(response_parser) ⇒ Object
44 45 46 |
# File 'lib/callapi/call/base.rb', line 44 def self.response_parser=(response_parser) @response_parser = response_parser end |
.strategy ⇒ Object
40 41 42 |
# File 'lib/callapi/call/base.rb', line 40 def self.strategy @strategy end |
.strategy=(strategy) ⇒ Object
36 37 38 |
# File 'lib/callapi/call/base.rb', line 36 def self.strategy=(strategy) @strategy = strategy end |
Instance Method Details
#reload ⇒ Object
52 53 54 |
# File 'lib/callapi/call/base.rb', line 52 def reload @response = nil end |
#request_metadata ⇒ Object
27 28 29 |
# File 'lib/callapi/call/base.rb', line 27 def Callapi::Call::RequestMetadata.new(self) end |
#response ⇒ Object
19 20 21 |
# File 'lib/callapi/call/base.rb', line 19 def response @response ||= build_response end |
#response_parser ⇒ Object
32 33 34 |
# File 'lib/callapi/call/base.rb', line 32 def response_parser @response_parser ||= (self.class.response_parser || Callapi::Config.default_response_parser) end |
#strategy ⇒ Object
23 24 25 |
# File 'lib/callapi/call/base.rb', line 23 def strategy @strategy ||= (self.class.strategy || Callapi::Config.default_request_strategy) end |