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.
2126 2127 2128 2129 2130 |
# File 'lib/kamelopard/classes.rb', line 2126 def initialize(x, y, z = 1) @x = x @y = y @z = z end |
Instance Attribute Details
#x ⇒ Object
Returns the value of attribute x.
2125 2126 2127 |
# File 'lib/kamelopard/classes.rb', line 2125 def x @x end |
#y ⇒ Object
Returns the value of attribute y.
2125 2126 2127 |
# File 'lib/kamelopard/classes.rb', line 2125 def y @y end |
#z ⇒ Object
Returns the value of attribute z.
2125 2126 2127 |
# File 'lib/kamelopard/classes.rb', line 2125 def z @z end |
Instance Method Details
#to_kml(elem = nil) ⇒ Object
2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 |
# File 'lib/kamelopard/classes.rb', line 2132 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 |