Class: Markdo::TaskAttribute
- Inherits:
-
Object
- Object
- Markdo::TaskAttribute
- Defined in:
- lib/markdo/models/task_attribute.rb
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #date_value ⇒ Object
-
#initialize(key, value) ⇒ TaskAttribute
constructor
A new instance of TaskAttribute.
Constructor Details
#initialize(key, value) ⇒ TaskAttribute
Returns a new instance of TaskAttribute.
7 8 9 10 |
# File 'lib/markdo/models/task_attribute.rb', line 7 def initialize(key, value) @key = key @value = value end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
5 6 7 |
# File 'lib/markdo/models/task_attribute.rb', line 5 def key @key end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
5 6 7 |
# File 'lib/markdo/models/task_attribute.rb', line 5 def value @value end |
Instance Method Details
#==(other) ⇒ Object
18 19 20 |
# File 'lib/markdo/models/task_attribute.rb', line 18 def ==(other) other.key == key && other.value == value end |
#date_value ⇒ Object
12 13 14 15 16 |
# File 'lib/markdo/models/task_attribute.rb', line 12 def date_value Date.parse(value.to_s) rescue ArgumentError nil end |