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.



15
16
17
# File 'lib/callapi/call/base.rb', line 15

def initialize(params = {})
  add_params(params)
end

Class Method Details

.response_parserObject



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

.strategyObject



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

#reloadObject



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

def reload
  @response = nil
end

#responseObject



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

def response
  @response ||= build_response
end

#response_parserObject



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

#strategyObject



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

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