Class: TimeStamp
- Inherits:
-
TimePrimitive
- Object
- KMLObject
- TimePrimitive
- TimeStamp
- Defined in:
- lib/kamelopard/classes.rb
Overview
Corresponds to KML’s TimeStamp object. The @when attribute must be in a format KML understands.
Instance Attribute Summary collapse
-
#when ⇒ Object
Returns the value of attribute when.
Attributes inherited from KMLObject
Instance Method Summary collapse
-
#initialize(t_when) ⇒ TimeStamp
constructor
A new instance of TimeStamp.
- #to_kml(indent = 0, ns = nil) ⇒ Object
Constructor Details
#initialize(t_when) ⇒ TimeStamp
Returns a new instance of TimeStamp.
475 476 477 478 |
# File 'lib/kamelopard/classes.rb', line 475 def initialize(t_when) super() @when = t_when end |
Instance Attribute Details
#when ⇒ Object
Returns the value of attribute when.
474 475 476 |
# File 'lib/kamelopard/classes.rb', line 474 def when @when end |
Instance Method Details
#to_kml(indent = 0, ns = nil) ⇒ Object
480 481 482 483 484 485 486 487 488 489 490 |
# File 'lib/kamelopard/classes.rb', line 480 def to_kml(indent = 0, ns = nil) prefix = '' prefix = ns + ':' unless ns.nil? k = super(indent + 4) k << <<-timestamp #{ ' ' * indent }<#{ prefix }TimeStamp id="#{ @id }"> #{ ' ' * indent } <when>#{ @when }</when> #{ ' ' * indent }</#{ prefix }TimeStamp> timestamp end |