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.
14 15 16 |
# File 'lib/callapi/call/base.rb', line 14 def initialize(params = {}) add_params(params) end |
Class Method Details
.response_parser ⇒ Object
42 43 44 |
# File 'lib/callapi/call/base.rb', line 42 def self.response_parser @response_parser end |
.response_parser=(response_parser) ⇒ Object
38 39 40 |
# File 'lib/callapi/call/base.rb', line 38 def self.response_parser=(response_parser) @response_parser = response_parser end |
.strategy ⇒ Object
34 35 36 |
# File 'lib/callapi/call/base.rb', line 34 def self.strategy @strategy end |
.strategy=(strategy) ⇒ Object
30 31 32 |
# File 'lib/callapi/call/base.rb', line 30 def self.strategy=(strategy) @strategy = strategy end |
Instance Method Details
#reload ⇒ Object
46 47 48 |
# File 'lib/callapi/call/base.rb', line 46 def reload @response = nil end |
#response ⇒ Object
18 19 20 |
# File 'lib/callapi/call/base.rb', line 18 def response @response ||= build_response end |
#response_parser ⇒ Object
26 27 28 |
# File 'lib/callapi/call/base.rb', line 26 def response_parser @response_parser ||= (self.class.response_parser || Callapi::Config.default_response_parser) end |
#strategy ⇒ Object
22 23 24 |
# File 'lib/callapi/call/base.rb', line 22 def strategy @strategy ||= (self.class.strategy || Callapi::Config.default_request_strategy) end |