Class: Kamelopard::Snippet

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

Overview

Support class for Feature object

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(text = nil, maxLines = 2) ⇒ Snippet

Returns a new instance of Snippet.



544
545
546
547
# File 'lib/kamelopard/classes.rb', line 544

def initialize(text = nil, maxLines = 2)
    @text = text
    @maxLines = maxLines
end

Instance Attribute Details

#maxLinesObject

Returns the value of attribute maxLines.



543
544
545
# File 'lib/kamelopard/classes.rb', line 543

def maxLines
  @maxLines
end

#textObject

Returns the value of attribute text.



543
544
545
# File 'lib/kamelopard/classes.rb', line 543

def text
  @text
end

Instance Method Details

#to_kml(elem = nil) ⇒ Object



549
550
551
552
553
554
555
# File 'lib/kamelopard/classes.rb', line 549

def to_kml(elem = nil)
    e = REXML::Element.new 'Snippet'
    e.attributes['maxLines'] = @maxLines
    e.text = @text
    elem.elements << e unless elem.nil?
    e
end