Class: Kamelopard::TimeStamp
- Inherits:
-
TimePrimitive
- Object
- Object
- TimePrimitive
- Kamelopard::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 Object
Instance Method Summary collapse
-
#initialize(ts_when = nil, options = {}) ⇒ TimeStamp
constructor
A new instance of TimeStamp.
- #to_kml(elem = nil, ns = nil) ⇒ Object
Methods inherited from Object
Constructor Details
#initialize(ts_when = nil, options = {}) ⇒ TimeStamp
Returns a new instance of TimeStamp.
504 505 506 507 |
# File 'lib/kamelopard/classes.rb', line 504 def initialize(ts_when = nil, = {}) super @when = ts_when unless ts_when.nil? end |
Instance Attribute Details
#when ⇒ Object
Returns the value of attribute when.
503 504 505 |
# File 'lib/kamelopard/classes.rb', line 503 def when @when end |
Instance Method Details
#to_kml(elem = nil, ns = nil) ⇒ Object
509 510 511 512 513 514 515 516 517 518 519 520 |
# File 'lib/kamelopard/classes.rb', line 509 def to_kml(elem = nil, ns = nil) prefix = '' prefix = ns + ':' unless ns.nil? k = XML::Node.new "#{prefix}TimeStamp" super(k) w = XML::Node.new 'when' w << @when k << w elem << k unless elem.nil? k end |