Class: Rox::Core::EvaluationResult

Inherits:
Object
  • Object
show all
Defined in:
lib/rox/core/roxx/evaluation_result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ EvaluationResult

Returns a new instance of EvaluationResult.



9
10
11
# File 'lib/rox/core/roxx/evaluation_result.rb', line 9

def initialize(value)
  @value = value
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



7
8
9
# File 'lib/rox/core/roxx/evaluation_result.rb', line 7

def value
  @value
end

Instance Method Details

#bool_valueObject



13
14
15
16
17
18
# File 'lib/rox/core/roxx/evaluation_result.rb', line 13

def bool_value
  return false if value.nil?
  return value if Utils.boolean?(value)

  nil
end

#string_valueObject



20
21
22
23
24
25
26
27
# File 'lib/rox/core/roxx/evaluation_result.rb', line 20

def string_value
  return value if value.is_a? String
  return nil if value.nil?
  return Flag::FLAG_TRUE_VALUE if value
  return Flag::FLAG_FALSE_VALUE unless value

  nil
end