Class: Logbook::Property
- Inherits:
-
Object
- Object
- Logbook::Property
- Defined in:
- lib/logbook/property.rb
Constant Summary collapse
- TAG_VALUE =
nil
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
- #has_value? ⇒ Boolean
-
#initialize(name, value = TAG_VALUE) ⇒ Property
constructor
A new instance of Property.
- #is_tag? ⇒ Boolean
Constructor Details
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/logbook/property.rb', line 3 def name @name end |
#value ⇒ Object
Returns the value of attribute value.
3 4 5 |
# File 'lib/logbook/property.rb', line 3 def value @value end |
Instance Method Details
#has_value? ⇒ Boolean
12 13 14 |
# File 'lib/logbook/property.rb', line 12 def has_value? !is_tag? && !value.strip.empty? end |
#is_tag? ⇒ Boolean
16 17 18 |
# File 'lib/logbook/property.rb', line 16 def is_tag? self.value === TAG_VALUE end |