Class: Callapi::Call::Base

Inherits:
Object
  • Object
show all
Extended by:
Forwardable, Memoist
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



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

.strategyObject



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

#reloadObject



52
53
54
# File 'lib/callapi/call/base.rb', line 52

def reload
  @response = nil
end

#request_metadataObject



27
28
29
# File 'lib/callapi/call/base.rb', line 27

def 
  Callapi::Call::.new(self)
end

#responseObject



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

def response
  @response ||= build_response
end

#response_parserObject



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

#strategyObject



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

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