Class: Kamelopard::Data

Inherits:
Object
  • Object
show all
Defined in:
lib/kamelopard/classes.rb

Overview

Corresponds to Data elements within ExtendedData

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, value, displayName = nil) ⇒ Data

Returns a new instance of Data.



835
836
837
838
839
# File 'lib/kamelopard/classes.rb', line 835

def initialize(name, value, displayName = nil)
    @name = name
    @displayName = displayName
    @value = value
end

Instance Attribute Details

#displayNameObject

Returns the value of attribute displayName.



834
835
836
# File 'lib/kamelopard/classes.rb', line 834

def displayName
  @displayName
end

#nameObject

Returns the value of attribute name.



834
835
836
# File 'lib/kamelopard/classes.rb', line 834

def name
  @name
end

#valueObject

Returns the value of attribute value.



834
835
836
# File 'lib/kamelopard/classes.rb', line 834

def value
  @value
end

Instance Method Details

#to_kml(elem = nil) ⇒ Object



841
842
843
844
845
846
847
848
849
850
# File 'lib/kamelopard/classes.rb', line 841

def to_kml(elem = nil)
    v = XML::Node.new 'Data'
    v.attributes['name'] = @name
    Kamelopard.kml_array(v, [
            [@value, 'value'],
            [@displayName, 'displayName']
        ])
    elem << v unless elem.nil?
    v
end