Class: PortaText::Command::Result
- Inherits:
-
Object
- Object
- PortaText::Command::Result
- Defined in:
- lib/portatext/command/result.rb
Overview
This class holds the result of calling the endpoint.
- Author
-
Marcelo Gornstein ([email protected])
- Copyright
-
Copyright © 2015 PortaText
- License
-
Apache-2.0
Instance Attribute Summary collapse
-
#code ⇒ Object
Returns the value of attribute code.
-
#data ⇒ Object
Returns the value of attribute data.
-
#headers ⇒ Object
Returns the value of attribute headers.
-
#success ⇒ Object
readonly
Returns the value of attribute success.
Instance Method Summary collapse
-
#initialize(code, headers, data) ⇒ Result
constructor
A new instance of Result.
Constructor Details
#initialize(code, headers, data) ⇒ Result
Returns a new instance of Result.
14 15 16 17 18 19 |
# File 'lib/portatext/command/result.rb', line 14 def initialize(code, headers, data) @code = code @headers = headers @data = data @success = code > 199 && code < 300 end |
Instance Attribute Details
#code ⇒ Object
Returns the value of attribute code.
9 10 11 |
# File 'lib/portatext/command/result.rb', line 9 def code @code end |
#data ⇒ Object
Returns the value of attribute data.
11 12 13 |
# File 'lib/portatext/command/result.rb', line 11 def data @data end |
#headers ⇒ Object
Returns the value of attribute headers.
10 11 12 |
# File 'lib/portatext/command/result.rb', line 10 def headers @headers end |
#success ⇒ Object (readonly)
Returns the value of attribute success.
12 13 14 |
# File 'lib/portatext/command/result.rb', line 12 def success @success end |