Class: KMLxy
- Inherits:
-
Object
- Object
- KMLxy
- Defined in:
- lib/kamelopard/classes.rb
Overview
Internal class used where KML requires X and Y values and units
Instance Attribute Summary collapse
-
#x ⇒ Object
Returns the value of attribute x.
-
#xunits ⇒ Object
Returns the value of attribute xunits.
-
#y ⇒ Object
Returns the value of attribute y.
-
#yunits ⇒ Object
Returns the value of attribute yunits.
Instance Method Summary collapse
-
#initialize(x = 0.5, y = 0.5, xunits = :fraction, yunits = :fraction) ⇒ KMLxy
constructor
A new instance of KMLxy.
- #to_kml(name, indent = 0) ⇒ Object
Constructor Details
#initialize(x = 0.5, y = 0.5, xunits = :fraction, yunits = :fraction) ⇒ KMLxy
Returns a new instance of KMLxy.
830 831 832 833 834 835 |
# File 'lib/kamelopard/classes.rb', line 830 def initialize(x = 0.5, y = 0.5, xunits = :fraction, yunits = :fraction) @x = x @y = y @xunits = xunits @yunits = yunits end |
Instance Attribute Details
#x ⇒ Object
Returns the value of attribute x.
829 830 831 |
# File 'lib/kamelopard/classes.rb', line 829 def x @x end |
#xunits ⇒ Object
Returns the value of attribute xunits.
829 830 831 |
# File 'lib/kamelopard/classes.rb', line 829 def xunits @xunits end |
#y ⇒ Object
Returns the value of attribute y.
829 830 831 |
# File 'lib/kamelopard/classes.rb', line 829 def y @y end |
#yunits ⇒ Object
Returns the value of attribute yunits.
829 830 831 |
# File 'lib/kamelopard/classes.rb', line 829 def yunits @yunits end |
Instance Method Details
#to_kml(name, indent = 0) ⇒ Object
837 838 839 840 841 842 |
# File 'lib/kamelopard/classes.rb', line 837 def to_kml(name, indent = 0) <<-kmlxy #{ ' ' * indent}<#{ name } x="#{ @x }" y="#{ @y }" xunits="#{ @xunits }" yunits="#{ @yunits }" /> kmlxy end |