Class: Logbook::Property

Inherits:
Object
  • Object
show all
Defined in:
lib/logbook/property.rb

Constant Summary collapse

TAG_VALUE =
nil

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, value = TAG_VALUE) ⇒ Property

Returns a new instance of Property.



7
8
9
10
# File 'lib/logbook/property.rb', line 7

def initialize(name, value = TAG_VALUE)
  @name = name
  @value = value
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/logbook/property.rb', line 3

def name
  @name
end

#valueObject

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

Returns:

  • (Boolean)


12
13
14
# File 'lib/logbook/property.rb', line 12

def has_value?
  !is_tag? && !value.strip.empty?
end

#is_tag?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/logbook/property.rb', line 16

def is_tag?
  self.value === TAG_VALUE
end