Class: Result
- Inherits:
-
Object
- Object
- Result
- Defined in:
- lib/Appolo/Models/result.rb
Instance Attribute Summary collapse
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#result ⇒ Object
readonly
Returns the value of attribute result.
Instance Method Summary collapse
- #has_result ⇒ Object
-
#initialize(result, error) ⇒ Result
constructor
A new instance of Result.
- #to_s ⇒ Object
Constructor Details
#initialize(result, error) ⇒ Result
Returns a new instance of Result.
5 6 7 8 9 10 11 |
# File 'lib/Appolo/Models/result.rb', line 5 def initialize(result, error) @result = result @error = error @message = @error. unless @error.nil? end |
Instance Attribute Details
#error ⇒ Object (readonly)
Returns the value of attribute error.
3 4 5 |
# File 'lib/Appolo/Models/result.rb', line 3 def error @error end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
3 4 5 |
# File 'lib/Appolo/Models/result.rb', line 3 def @message end |
#result ⇒ Object (readonly)
Returns the value of attribute result.
3 4 5 |
# File 'lib/Appolo/Models/result.rb', line 3 def result @result end |
Instance Method Details
#has_result ⇒ Object
13 14 15 |
# File 'lib/Appolo/Models/result.rb', line 13 def has_result @result.nil? end |
#to_s ⇒ Object
17 18 19 |
# File 'lib/Appolo/Models/result.rb', line 17 def to_s "Has Result: #{has_result} Has Error: #{@has_error}" end |