Class: CheckMot::Attribute
- Inherits:
-
Object
- Object
- CheckMot::Attribute
- Defined in:
- lib/check_mot/attribute.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(value) ⇒ Attribute
constructor
A new instance of Attribute.
Constructor Details
#initialize(value) ⇒ Attribute
Returns a new instance of Attribute.
6 7 8 |
# File 'lib/check_mot/attribute.rb', line 6 def initialize(value) @value = value end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
4 5 6 |
# File 'lib/check_mot/attribute.rb', line 4 def value @value end |
Class Method Details
.resolve(name, value) ⇒ Object
10 11 12 13 14 |
# File 'lib/check_mot/attribute.rb', line 10 def self.resolve(name, value) [DateAttribute].map do |attribute| attribute.try(name, value) end.first || value end |