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.



453
454
455
456
# File 'lib/openehr/parser/opt_parser.rb', line 453

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

Instance Attribute Details

#idObject

Returns the value of attribute id.



450
451
452
# File 'lib/openehr/parser/opt_parser.rb', line 450

def id
  @id
end

#parentObject (readonly)

Returns the value of attribute parent.



451
452
453
# File 'lib/openehr/parser/opt_parser.rb', line 451

def parent
  @parent
end

#pathObject

Returns the value of attribute path.



450
451
452
# File 'lib/openehr/parser/opt_parser.rb', line 450

def path
  @path
end

Instance Method Details

#root?Boolean

Returns:

  • (Boolean)


458
459
460
# File 'lib/openehr/parser/opt_parser.rb', line 458

def root?
  parent.nil?
end