Class: Prick::Build::BuildNode

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

Direct Known Subclasses

RootBuildNode

Instance Attribute Summary collapse

Attributes inherited from Node

#args, #kind, #parent, #path, #phase, #source

Instance Method Summary collapse

Methods inherited from Node

#lines, #name, #prefix_lines, #schema, #schema=, #source_lines, #to_s

Constructor Details

#initialize(parent, path) ⇒ BuildNode



153
154
155
156
157
158
159
# File 'lib/builder/node.rb', line 153

def initialize(parent, path)
  super(parent, nil, :yml, path)
  @decl_nodes = []
  @init_nodes = []
  @term_nodes = []
  @seed_nodes = []
end

Instance Attribute Details

#decl_nodesObject (readonly)

Returns the value of attribute decl_nodes.



148
149
150
# File 'lib/builder/node.rb', line 148

def decl_nodes
  @decl_nodes
end

#init_nodesObject (readonly)

Returns the value of attribute init_nodes.



149
150
151
# File 'lib/builder/node.rb', line 149

def init_nodes
  @init_nodes
end

#seed_nodesObject (readonly)

Returns the value of attribute seed_nodes.



151
152
153
# File 'lib/builder/node.rb', line 151

def seed_nodes
  @seed_nodes
end

#term_nodesObject (readonly)

Returns the value of attribute term_nodes.



150
151
152
# File 'lib/builder/node.rb', line 150

def term_nodes
  @term_nodes
end

Instance Method Details

#dumpObject



163
164
165
166
167
168
169
170
171
172
173
174
175
176
# File 'lib/builder/node.rb', line 163

def dump
  puts "BuildNode #{path}"
  indent {
    puts "schema: #{schema}" if schema
    decl_nodes.each(&:dump)
    for kind in [:init, :term, :seed]
      kind_nodes = self.send("#{kind}_nodes".to_sym)
      if !kind_nodes.empty?
        puts "#{kind.upcase}:"
        indent { kind_nodes.each(&:dump) } 
      end
    end
  }
end

#inspectObject



161
# File 'lib/builder/node.rb', line 161

def inspect() to_s end

#nodesObject



146
# File 'lib/builder/node.rb', line 146

def nodes() @nodes ||= init_nodes + decl_nodes + seed_nodes + term_nodes end