Class: Lark::Result
- Inherits:
-
Object
- Object
- Lark::Result
- Defined in:
- lib/lark/request.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Instance Method Summary collapse
-
#initialize(data) ⇒ Result
constructor
A new instance of Result.
- #success? ⇒ Boolean
Constructor Details
#initialize(data) ⇒ Result
Returns a new instance of Result.
102 103 104 105 |
# File 'lib/lark/request.rb', line 102 def initialize(data) @code = data['code'].to_i @data = data end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
100 101 102 |
# File 'lib/lark/request.rb', line 100 def code @code end |
#data ⇒ Object (readonly)
Returns the value of attribute data.
100 101 102 |
# File 'lib/lark/request.rb', line 100 def data @data end |
Instance Method Details
#success? ⇒ Boolean
107 108 109 |
# File 'lib/lark/request.rb', line 107 def success? code.zero? end |