Class: Avmtrf1::Result

Inherits:
Object
  • Object
show all
Includes:
EacRubyUtils::Listable
Defined in:
lib/avmtrf1/result.rb

Constant Summary collapse

TYPE_SUCCESS_COLOR =
'green'
TYPE_ERROR_COLOR =
'red'
TYPE_NEUTRAL_COLOR =
'white'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type, output) ⇒ Result

Returns a new instance of Result.


26
27
28
29
30
# File 'lib/avmtrf1/result.rb', line 26

def initialize(type, output)
  validate_type(type)
  @type = type
  @output = output
end

Instance Attribute Details

#outputObject (readonly)

Returns the value of attribute output.


24
25
26
# File 'lib/avmtrf1/result.rb', line 24

def output
  @output
end

#typeObject (readonly)

Returns the value of attribute type.


24
25
26
# File 'lib/avmtrf1/result.rb', line 24

def type
  @type
end

Instance Method Details

#labelObject


32
33
34
# File 'lib/avmtrf1/result.rb', line 32

def label
  output.send(self.class.const_get("type_#{type}_color".upcase))
end