Class: Kamelopard::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 Object
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(elem = nil) ⇒ Object
Methods inherited from Object
Constructor Details
#initialize(name = nil, description = nil) ⇒ Tour
Returns a new instance of Tour.
1445 1446 1447 1448 1449 1450 1451 |
# File 'lib/kamelopard/classes.rb', line 1445 def initialize(name = nil, description = nil) super() @name = name @description = description @items = [] Document.instance.tours << self end |
Instance Attribute Details
#description ⇒ Object
Returns the value of attribute description.
1444 1445 1446 |
# File 'lib/kamelopard/classes.rb', line 1444 def description @description end |
#last_abs_view ⇒ Object
Returns the value of attribute last_abs_view.
1444 1445 1446 |
# File 'lib/kamelopard/classes.rb', line 1444 def last_abs_view @last_abs_view end |
#name ⇒ Object
Returns the value of attribute name.
1444 1445 1446 |
# File 'lib/kamelopard/classes.rb', line 1444 def name @name end |
Instance Method Details
#<<(a) ⇒ Object
Add another element to this Tour
1454 1455 1456 1457 |
# File 'lib/kamelopard/classes.rb', line 1454 def <<(a) @items << a @last_abs_view = a.view if a.kind_of? FlyTo end |
#to_kml(elem = nil) ⇒ Object
1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 |
# File 'lib/kamelopard/classes.rb', line 1459 def to_kml(elem = nil) k = XML::Node.new 'gx:Tour' super k Kamelopard.kml_array(k, [ [ @name, 'name' ], [ @description, 'description' ], ]) p = XML::Node.new 'gx:Playlist' @items.map do |a| a.to_kml p end k << p elem << k unless elem.nil? k end |