Class: Snippet
- Inherits:
-
Object
- Object
- Snippet
- Defined in:
- lib/kamelopard/classes.rb
Overview
Support class for Feature object
Instance Attribute Summary collapse
-
#maxLines ⇒ Object
Returns the value of attribute maxLines.
-
#text ⇒ Object
Returns the value of attribute text.
Instance Method Summary collapse
-
#initialize(text = nil, maxLines = 2) ⇒ Snippet
constructor
A new instance of Snippet.
- #to_kml(indent = 0) ⇒ Object
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
#maxLines ⇒ Object
Returns the value of attribute maxLines.
517 518 519 |
# File 'lib/kamelopard/classes.rb', line 517 def maxLines @maxLines end |
#text ⇒ Object
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 |