Class: PolyrexObjects::PolyrexObject

Inherits:
Object
  • Object
show all
Defined in:
lib/polyrex-objects.rb

Instance Method Summary collapse

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

#deleteObject



28
29
30
# File 'lib/polyrex-objects.rb', line 28

def delete()
  @node.delete
end

#inspectObject



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(options={})
  @node.xml(options)
end

#with {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:



40
41
42
# File 'lib/polyrex-objects.rb', line 40

def with()
  yield(self)
end