Class: Scale
- Inherits:
-
Object
- Object
- 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(indent = 0) ⇒ Object
Constructor Details
#initialize(x, y, z = 1) ⇒ Scale
Returns a new instance of Scale.
1592 1593 1594 1595 1596 |
# File 'lib/kamelopard/classes.rb', line 1592 def initialize(x, y, z = 1) @x = x @y = y @z = z end |
Instance Attribute Details
#x ⇒ Object
Returns the value of attribute x.
1591 1592 1593 |
# File 'lib/kamelopard/classes.rb', line 1591 def x @x end |
#y ⇒ Object
Returns the value of attribute y.
1591 1592 1593 |
# File 'lib/kamelopard/classes.rb', line 1591 def y @y end |
#z ⇒ Object
Returns the value of attribute z.
1591 1592 1593 |
# File 'lib/kamelopard/classes.rb', line 1591 def z @z end |
Instance Method Details
#to_kml(indent = 0) ⇒ Object
1598 1599 1600 1601 1602 1603 1604 |
# File 'lib/kamelopard/classes.rb', line 1598 def to_kml(indent = 0) k = "#{ ' ' * indent }<Scale>\n" k << "#{ ' ' * indent } <x>#{ x }</x>\n" k << "#{ ' ' * indent } <y>#{ y }</y>\n" k << "#{ ' ' * indent } <z>#{ z }</z>\n" k << "#{ ' ' * indent }</Scale>\n" end |