Class: KMLxy

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

Overview

Internal class used where KML requires X and Y values and units

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (KMLxy) initialize(x = 0.5, y = 0.5, xunits = :fraction, yunits = :fraction)

A new instance of KMLxy



758
759
760
761
762
763
# File 'lib/kamelopard/classes.rb', line 758

def initialize(x = 0.5, y = 0.5, xunits = :fraction, yunits = :fraction)
    @x = x
    @y = y
    @xunits = xunits
    @yunits = yunits
end

Instance Attribute Details

- (Object) x

Returns the value of attribute x



757
758
759
# File 'lib/kamelopard/classes.rb', line 757

def x
  @x
end

- (Object) xunits

Returns the value of attribute xunits



757
758
759
# File 'lib/kamelopard/classes.rb', line 757

def xunits
  @xunits
end

- (Object) y

Returns the value of attribute y



757
758
759
# File 'lib/kamelopard/classes.rb', line 757

def y
  @y
end

- (Object) yunits

Returns the value of attribute yunits



757
758
759
# File 'lib/kamelopard/classes.rb', line 757

def yunits
  @yunits
end

Instance Method Details

- (Object) to_kml(name, indent = 0)



765
766
767
768
769
770
# File 'lib/kamelopard/classes.rb', line 765

def to_kml(name, indent = 0)

    <<-kmlxy
#{ ' ' * indent}<#{ name } x="#{ @x }" y="#{ @y }" xunits="#{ @xunits }" yunits="#{ @yunits }" />
    kmlxy
end