module Searchr::Node

Attributes

explain_line[R]
parent[R]

Public Class Methods

new(parent, explain_line) click to toggle source
# File lib/searchr/explanation_parser.rb, line 104
def initialize(parent, explain_line)
  set_parent parent
  @explain_line = explain_line
end

Public Instance Methods

children() click to toggle source
# File lib/searchr/explanation_parser.rb, line 113
def children
  @children ||= []
end
is_leaf() click to toggle source
# File lib/searchr/explanation_parser.rb, line 117
def is_leaf
  false
end
score() click to toggle source
# File lib/searchr/explanation_parser.rb, line 109
def score
  @explain_line.score
end

Private Instance Methods

set_parent(parent) click to toggle source
# File lib/searchr/explanation_parser.rb, line 123
def set_parent(parent)
  @parent = parent
  @parent.children << self if parent
end