Class: GraphBuilder::Leaf

Inherits:
Base
  • Object
show all
Defined in:
lib/graph_builder.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#children, #opts, #parent

Instance Method Summary collapse

Methods inherited from Base

#ancestors, #debug, #depth, #dump, #indent, #process

Constructor Details

#initialize(parent, thing) ⇒ Leaf

Returns a new instance of Leaf.



54
55
56
57
# File 'lib/graph_builder.rb', line 54

def initialize parent, thing
  @thing = thing
  super parent
end

Instance Attribute Details

#thingObject (readonly)

Returns the value of attribute thing.



53
54
55
# File 'lib/graph_builder.rb', line 53

def thing
  @thing
end

Instance Method Details

#empty?Boolean

Returns:

  • (Boolean)


59
# File 'lib/graph_builder.rb', line 59

def empty?;       false;         end

#first_thingsObject



61
# File 'lib/graph_builder.rb', line 61

def first_things; thing;         end

#last_thingsObject



60
# File 'lib/graph_builder.rb', line 60

def last_things;  thing;         end

#to_sObject



62
# File 'lib/graph_builder.rb', line 62

def to_s;         "[#{thing}]";  end