Class: Kamelopard::Scale
- Inherits:
-
Object
- Object
- Kamelopard::Scale
- Defined in:
- lib/kamelopard/classes.rb
Overview
Sub-object in the KML Model class
Instance Attribute Summary collapse
-
#x ⇒ Object
Returns the value of attribute x.
-
#y ⇒ Object
Returns the value of attribute y.
-
#z ⇒ Object
Returns the value of attribute z.
Instance Method Summary collapse
-
#initialize(x, y, z = 1) ⇒ Scale
constructor
A new instance of Scale.
- #to_kml(elem = nil) ⇒ Object
Constructor Details
#initialize(x, y, z = 1) ⇒ Scale
Returns a new instance of Scale.
2285 2286 2287 2288 2289 |
# File 'lib/kamelopard/classes.rb', line 2285 def initialize(x, y, z = 1) @x = x @y = y @z = z end |
Instance Attribute Details
#x ⇒ Object
Returns the value of attribute x.
2284 2285 2286 |
# File 'lib/kamelopard/classes.rb', line 2284 def x @x end |
#y ⇒ Object
Returns the value of attribute y.
2284 2285 2286 |
# File 'lib/kamelopard/classes.rb', line 2284 def y @y end |
#z ⇒ Object
Returns the value of attribute z.
2284 2285 2286 |
# File 'lib/kamelopard/classes.rb', line 2284 def z @z end |
Instance Method Details
#to_kml(elem = nil) ⇒ Object
2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 |
# File 'lib/kamelopard/classes.rb', line 2291 def to_kml(elem = nil) x = XML::Node.new 'Scale' { :x => @x, :y => @y, :z => @z }.each do |k, v| d = XML::Node.new k.to_s d << v.to_s x << d end elem << x unless elem.nil? x end |