Class: Tod::Result
- Inherits:
-
Object
- Object
- Tod::Result
- Defined in:
- lib/tod/result.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
Instance Method Summary collapse
- #error? ⇒ Boolean
-
#initialize(code) ⇒ Result
constructor
A new instance of Result.
- #ok? ⇒ Boolean
Constructor Details
#initialize(code) ⇒ Result
Returns a new instance of Result.
6 7 8 |
# File 'lib/tod/result.rb', line 6 def initialize(code) @code = code.to_i end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
4 5 6 |
# File 'lib/tod/result.rb', line 4 def code @code end |
Instance Method Details
#error? ⇒ Boolean
14 15 16 |
# File 'lib/tod/result.rb', line 14 def error? !ok? end |
#ok? ⇒ Boolean
10 11 12 |
# File 'lib/tod/result.rb', line 10 def ok? code.zero? end |