Class: Callapi::Call::Base

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/callapi/call/base.rb

Class Method Summary collapse

Instance Method Summary collapse

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_parserObject



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

.strategyObject



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

#reloadObject



46
47
48
# File 'lib/callapi/call/base.rb', line 46

def reload
  @response = nil
end

#responseObject



18
19
20
# File 'lib/callapi/call/base.rb', line 18

def response
  @response ||= build_response
end

#response_parserObject



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

#strategyObject



22
23
24
# File 'lib/callapi/call/base.rb', line 22

def strategy
  @strategy ||= (self.class.strategy || Callapi::Config.default_request_strategy)
end