Class: Prick::Build::BuildNode
Overview
A build.yml file node
Direct Known Subclasses
Instance Attribute Summary collapse
-
#decl_nodes ⇒ Object
readonly
Returns the value of attribute decl_nodes.
-
#has_schema ⇒ Object
True if the build file contains a ‘schema’ attribute.
-
#init_nodes ⇒ Object
readonly
Returns the value of attribute init_nodes.
-
#pg_graph_ignore_schema ⇒ Object
Returns the value of attribute pg_graph_ignore_schema.
-
#refresh_schema ⇒ Object
Returns the value of attribute refresh_schema.
-
#seed_nodes ⇒ Object
readonly
Returns the value of attribute seed_nodes.
-
#term_nodes ⇒ Object
readonly
Returns the value of attribute term_nodes.
Attributes inherited from Node
#args, #kind, #parent, #path, #phase
Instance Method Summary collapse
- #dump ⇒ Object
-
#initialize(parent, path) ⇒ BuildNode
constructor
A new instance of BuildNode.
- #inspect ⇒ Object
- #nodes ⇒ Object
Methods inherited from Node
#lines, #name, #prefix_lines, #relpath, #schema, #schema=, #source, #source_lines, #to_s
Constructor Details
#initialize(parent, path) ⇒ BuildNode
Returns a new instance of BuildNode.
255 256 257 258 259 260 261 262 263 |
# File 'lib/prick/builder/node.rb', line 255 def initialize(parent, path) super(parent, nil, :yml, path) @decl_nodes = [] @init_nodes = [] @term_nodes = [] @seed_nodes = [] @pg_graph_ignore_schema = false @refresh_schema = true end |
Instance Attribute Details
#decl_nodes ⇒ Object (readonly)
Returns the value of attribute decl_nodes.
247 248 249 |
# File 'lib/prick/builder/node.rb', line 247 def decl_nodes @decl_nodes end |
#has_schema ⇒ Object
True if the build file contains a ‘schema’ attribute
243 244 245 |
# File 'lib/prick/builder/node.rb', line 243 def has_schema @has_schema end |
#init_nodes ⇒ Object (readonly)
Returns the value of attribute init_nodes.
248 249 250 |
# File 'lib/prick/builder/node.rb', line 248 def init_nodes @init_nodes end |
#pg_graph_ignore_schema ⇒ Object
Returns the value of attribute pg_graph_ignore_schema.
252 253 254 |
# File 'lib/prick/builder/node.rb', line 252 def pg_graph_ignore_schema @pg_graph_ignore_schema end |
#refresh_schema ⇒ Object
Returns the value of attribute refresh_schema.
253 254 255 |
# File 'lib/prick/builder/node.rb', line 253 def refresh_schema @refresh_schema end |
#seed_nodes ⇒ Object (readonly)
Returns the value of attribute seed_nodes.
250 251 252 |
# File 'lib/prick/builder/node.rb', line 250 def seed_nodes @seed_nodes end |
#term_nodes ⇒ Object (readonly)
Returns the value of attribute term_nodes.
249 250 251 |
# File 'lib/prick/builder/node.rb', line 249 def term_nodes @term_nodes end |
Instance Method Details
#dump ⇒ Object
267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 |
# File 'lib/prick/builder/node.rb', line 267 def dump puts "BuildNode #{path}" indent { puts "has_schema: #{has_schema}" puts "schema: #{@schema || 'nil'}" puts "refresh: #{refresh_schema.to_s}" puts "pg_graph_ignore_schema: #{pg_graph_ignore_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}:" indent { kind_nodes.each(&:dump) } end end } end |
#inspect ⇒ Object
265 |
# File 'lib/prick/builder/node.rb', line 265 def inspect() to_s end |
#nodes ⇒ Object
245 |
# File 'lib/prick/builder/node.rb', line 245 def nodes() @nodes ||= init_nodes + decl_nodes + seed_nodes + term_nodes end |