Class: 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.



518
519
520
521
# File 'lib/kamelopard/classes.rb', line 518

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

Instance Attribute Details

#maxLinesObject

Returns the value of attribute maxLines.



517
518
519
# File 'lib/kamelopard/classes.rb', line 517

def maxLines
  @maxLines
end

#textObject

Returns the value of attribute text.



517
518
519
# File 'lib/kamelopard/classes.rb', line 517

def text
  @text
end

Instance Method Details

#to_kml(indent = 0) ⇒ Object



523
524
525
526
527
# File 'lib/kamelopard/classes.rb', line 523

def to_kml(indent = 0)
    k = "#{ ' ' * indent }<Snippet maxLines=\"#{maxLines}\">"
    k << text
    k << "#{ ' ' * indent }</Snippet>\n"
end