Class: Callapi::Call::Parser
- Inherits:
-
Object
- Object
- Callapi::Call::Parser
- Extended by:
- Forwardable
- Defined in:
- lib/callapi/call/response.rb
Overview
Change it to Callapi::Call::Parser::Base
Defined Under Namespace
Instance Method Summary collapse
- #data ⇒ Object
-
#initialize(response) ⇒ Parser
constructor
A new instance of Parser.
- #status ⇒ Object
Constructor Details
#initialize(response) ⇒ Parser
Returns a new instance of Parser.
11 12 13 |
# File 'lib/callapi/call/response.rb', line 11 def initialize(response) @response = response end |
Instance Method Details
#data ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/callapi/call/response.rb', line 15 def data return @data if @data raise_error unless ok? return nil if no_content? @data = parse end |
#status ⇒ Object
24 25 26 |
# File 'lib/callapi/call/response.rb', line 24 def status code.to_i end |