Class: Node

Inherits:
Object
  • Object
show all
Defined in:
lib/openehr/parser/opt_parser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(parent = nil) ⇒ Node

Returns a new instance of Node.



602
603
604
605
# File 'lib/openehr/parser/opt_parser.rb', line 602

def initialize(parent = nil)
  @parent = parent
  @path = '/' if parent.nil?
end

Instance Attribute Details

#idObject

Returns the value of attribute id.



599
600
601
# File 'lib/openehr/parser/opt_parser.rb', line 599

def id
  @id
end

#parentObject (readonly)

Returns the value of attribute parent.



600
601
602
# File 'lib/openehr/parser/opt_parser.rb', line 600

def parent
  @parent
end

#pathObject

Returns the value of attribute path.



599
600
601
# File 'lib/openehr/parser/opt_parser.rb', line 599

def path
  @path
end

Instance Method Details

#root?Boolean

Returns:

  • (Boolean)


607
608
609
# File 'lib/openehr/parser/opt_parser.rb', line 607

def root?
  parent.nil?
end