Class: Callapi::Call::Base
- Inherits:
-
Object
- Object
- Callapi::Call::Base
- Extended by:
- Forwardable
- 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
- #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
43 44 45 |
# File 'lib/callapi/call/base.rb', line 43 def self.response_parser @response_parser end |
.response_parser=(response_parser) ⇒ Object
39 40 41 |
# File 'lib/callapi/call/base.rb', line 39 def self.response_parser=(response_parser) @response_parser = response_parser end |
.strategy ⇒ Object
35 36 37 |
# File 'lib/callapi/call/base.rb', line 35 def self.strategy @strategy end |
.strategy=(strategy) ⇒ Object
31 32 33 |
# File 'lib/callapi/call/base.rb', line 31 def self.strategy=(strategy) @strategy = strategy end |
Instance Method Details
#reload ⇒ Object
47 48 49 |
# File 'lib/callapi/call/base.rb', line 47 def reload @response = nil end |
#response ⇒ Object
19 20 21 |
# File 'lib/callapi/call/base.rb', line 19 def response @response ||= build_response end |
#response_parser ⇒ Object
27 28 29 |
# File 'lib/callapi/call/base.rb', line 27 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 |