Class: Umwelt::Node::Base

Inherits:
Struct::Node
  • Object
show all
Defined in:
lib/umwelt/node.rb

Direct Known Subclasses

Root, Space

Instance Method Summary collapse

Instance Method Details

#ancestryObject



15
16
17
18
19
20
21
# File 'lib/umwelt/node.rb', line 15

def ancestry
  if context_id
    context.ancestry << self
  else
    [self]
  end
end

#contextObject



23
24
25
# File 'lib/umwelt/node.rb', line 23

def context
  tree.node(context_id)
end

#labelObject



27
28
29
# File 'lib/umwelt/node.rb', line 27

def label
  self.class.name.split('::').last.to_sym
end

#semantic(semantic_name) ⇒ Object



11
12
13
# File 'lib/umwelt/node.rb', line 11

def semantic(semantic_name)
  semantic_klass(semantic_name).new(node: self)
end

#semanticsObject



7
8
9
# File 'lib/umwelt/node.rb', line 7

def semantics
  [:Plain]
end