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.



191
192
193
194
# File 'lib/openehr/parser/opt_parser.rb', line 191

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

Instance Attribute Details

#idObject

Returns the value of attribute id.



188
189
190
# File 'lib/openehr/parser/opt_parser.rb', line 188

def id
  @id
end

#parentObject (readonly)

Returns the value of attribute parent.



189
190
191
# File 'lib/openehr/parser/opt_parser.rb', line 189

def parent
  @parent
end

#pathObject

Returns the value of attribute path.



188
189
190
# File 'lib/openehr/parser/opt_parser.rb', line 188

def path
  @path
end

Instance Method Details

#root?Boolean

Returns:

  • (Boolean)


196
197
198
# File 'lib/openehr/parser/opt_parser.rb', line 196

def root?
  parent.nil?
end