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.
2163 2164 2165 2166 2167 |
# File 'lib/kamelopard/classes.rb', line 2163 def initialize(x, y, z = 1) @x = x @y = y @z = z end |
Instance Attribute Details
#x ⇒ Object
Returns the value of attribute x.
2162 2163 2164 |
# File 'lib/kamelopard/classes.rb', line 2162 def x @x end |
#y ⇒ Object
Returns the value of attribute y.
2162 2163 2164 |
# File 'lib/kamelopard/classes.rb', line 2162 def y @y end |
#z ⇒ Object
Returns the value of attribute z.
2162 2163 2164 |
# File 'lib/kamelopard/classes.rb', line 2162 def z @z end |
Instance Method Details
#to_kml(elem = nil) ⇒ Object
2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 |
# File 'lib/kamelopard/classes.rb', line 2169 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 |