Class: Tour
Overview
Corresponds to a KML gx:Tour object
Instance Attribute Summary collapse
-
#description ⇒ Object
Returns the value of attribute description.
-
#last_abs_view ⇒ Object
Returns the value of attribute last_abs_view.
-
#name ⇒ Object
Returns the value of attribute name.
Attributes inherited from KMLObject
Instance Method Summary collapse
-
#<<(a) ⇒ Object
Add another element to this Tour.
-
#initialize(name = nil, description = nil) ⇒ Tour
constructor
A new instance of Tour.
- #to_kml(indent = 0) ⇒ Object
Constructor Details
#initialize(name = nil, description = nil) ⇒ Tour
Returns a new instance of Tour.
1260 1261 1262 1263 1264 1265 |
# File 'lib/kamelopard/classes.rb', line 1260 def initialize(name = nil, description = nil) super() @name = name @description = description @items = [] end |
Instance Attribute Details
#description ⇒ Object
Returns the value of attribute description.
1259 1260 1261 |
# File 'lib/kamelopard/classes.rb', line 1259 def description @description end |
#last_abs_view ⇒ Object
Returns the value of attribute last_abs_view.
1259 1260 1261 |
# File 'lib/kamelopard/classes.rb', line 1259 def last_abs_view @last_abs_view end |
#name ⇒ Object
Returns the value of attribute name.
1259 1260 1261 |
# File 'lib/kamelopard/classes.rb', line 1259 def name @name end |
Instance Method Details
#<<(a) ⇒ Object
Add another element to this Tour
1268 1269 1270 1271 |
# File 'lib/kamelopard/classes.rb', line 1268 def <<(a) @items << a @last_abs_view = a.view if a.kind_of? FlyTo end |
#to_kml(indent = 0) ⇒ Object
1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 |
# File 'lib/kamelopard/classes.rb', line 1273 def to_kml(indent = 0) k = super + "#{ ' ' * indent }<gx:Tour id=\"#{ @id }\">\n" k << kml_array([ [ @name, 'name', true ], [ @description, 'description', true ], ], indent + 4) k << "#{ ' ' * indent } <gx:Playlist>\n"; @items.map do |a| k << a.to_kml(indent + 8) << "\n" end k << "#{ ' ' * indent } </gx:Playlist>\n" k << "#{ ' ' * indent }</gx:Tour>\n" k end |