Class: RXaal::Coordinate
- Inherits:
-
XaalElement
- Object
- XaalElement
- RXaal::Coordinate
- Defined in:
- lib/coordinate.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#xpos ⇒ Object
Returns the value of attribute xpos.
-
#ypos ⇒ Object
Returns the value of attribute ypos.
Attributes inherited from XaalElement
Instance Method Summary collapse
-
#initialize(doc, xpos, ypos, id = nil, elem_ns = nil) ⇒ Coordinate
constructor
A new instance of Coordinate.
- #xaal_serialize(parent) ⇒ Object
Methods inherited from XaalElement
#add_attribute, #add_ref, get_new_default_id, modify_ref, #rm_ref, #superclass_serialize
Constructor Details
#initialize(doc, xpos, ypos, id = nil, elem_ns = nil) ⇒ Coordinate
Returns a new instance of Coordinate.
4 5 6 7 8 |
# File 'lib/coordinate.rb', line 4 def initialize(doc, xpos, ypos, id= nil, elem_ns=nil) super(doc, id, elem_ns) @xpos= xpos @ypos= ypos end |
Instance Attribute Details
#xpos ⇒ Object
Returns the value of attribute xpos.
3 4 5 |
# File 'lib/coordinate.rb', line 3 def xpos @xpos end |
#ypos ⇒ Object
Returns the value of attribute ypos.
3 4 5 |
# File 'lib/coordinate.rb', line 3 def ypos @ypos end |
Instance Method Details
#xaal_serialize(parent) ⇒ Object
10 11 12 13 14 15 16 17 18 |
# File 'lib/coordinate.rb', line 10 def xaal_serialize(parent) elem = Element.new "coordinate" elem.attributes["x"] = @xpos.to_s elem.attributes["y"] = @ypos.to_s elem.attributes["id"] = self.id parent.elements << elem superclass_serialize(elem) end |