Class: Scale

Inherits:
Object
  • Object
show all
Defined in:
lib/kamelopard/classes.rb

Overview

Sub-object in the KML Model class

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#xObject

Returns the value of attribute x.



1591
1592
1593
# File 'lib/kamelopard/classes.rb', line 1591

def x
  @x
end

#yObject

Returns the value of attribute y.



1591
1592
1593
# File 'lib/kamelopard/classes.rb', line 1591

def y
  @y
end

#zObject

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