Class: Result

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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.message unless @error.nil?

end

Instance Attribute Details

#errorObject (readonly)

Returns the value of attribute error.



3
4
5
# File 'lib/Appolo/Models/result.rb', line 3

def error
  @error
end

#messageObject (readonly)

Returns the value of attribute message.



3
4
5
# File 'lib/Appolo/Models/result.rb', line 3

def message
  @message
end

#resultObject (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_resultObject



13
14
15
# File 'lib/Appolo/Models/result.rb', line 13

def has_result
  @result.nil?
end

#to_sObject



17
18
19
# File 'lib/Appolo/Models/result.rb', line 17

def to_s
  "Has Result: #{has_result} Has Error: #{@has_error}"
end