Method: Clerq::Entities::Node#node
- Defined in:
- lib/clerq/entities/node.rb
#node(id) ⇒ Node
Find the first node in the node hierarchy by its id.
Add '*' prefix to find id by ends_with?
130 131 132 133 134 135 136 |
# File 'lib/clerq/entities/node.rb', line 130 def node(id) if id.start_with? '*' ai = id[1..-1] return find {|n| n.id.end_with? ai} end find{|n| n.id.eql? id} end |