Class: Tod::Result

Inherits:
Object
  • Object
show all
Defined in:
lib/tod/result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#codeObject (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

Returns:

  • (Boolean)


14
15
16
# File 'lib/tod/result.rb', line 14

def error?
  !ok?
end

#ok?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/tod/result.rb', line 10

def ok?
  code.zero?
end