Class: PolyrexObjects::PolyrexObject
- Inherits:
-
Object
- Object
- PolyrexObjects::PolyrexObject
- Defined in:
- lib/polyrex-objects.rb
Instance Method Summary collapse
- #create(id = nil) ⇒ Object
- #delete ⇒ Object
-
#initialize(node, id = '0') ⇒ PolyrexObject
constructor
A new instance of PolyrexObject.
- #inspect ⇒ Object
- #to_xml(options = {}) ⇒ Object
- #with {|_self| ... } ⇒ Object
Constructor Details
#initialize(node, id = '0') ⇒ PolyrexObject
Returns a new instance of PolyrexObject.
14 15 16 17 |
# File 'lib/polyrex-objects.rb', line 14 def initialize(node, id='0') @@id = id @node = node end |
Instance Method Details
#create(id = nil) ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'lib/polyrex-objects.rb', line 19 def create(id=nil) id ||= @@id id.succ! @create.id = id @create.record = @node.element('records') @create end |
#delete ⇒ Object
28 29 30 |
# File 'lib/polyrex-objects.rb', line 28 def delete() @node.delete end |
#inspect ⇒ Object
32 33 34 |
# File 'lib/polyrex-objects.rb', line 32 def inspect() "#<PolyrexObject:%s" % __id__ end |
#to_xml(options = {}) ⇒ Object
36 37 38 |
# File 'lib/polyrex-objects.rb', line 36 def to_xml(={}) @node.xml() end |
#with {|_self| ... } ⇒ Object
40 41 42 |
# File 'lib/polyrex-objects.rb', line 40 def with() yield(self) end |