class Bricolage::SQLFileParam
Public Class Methods
new(name = 'sql-file', arg_spec = 'PATH', description = 'SQL file.', optional: false, publish: false)
click to toggle source
Calls superclass method
Bricolage::Param::new
# File lib/bricolage/parameters.rb, line 471 def initialize(name = 'sql-file', arg_spec = 'PATH', description = 'SQL file.', optional: false, publish: false) super name, arg_spec, description, optional: optional, publish: publish end
Public Instance Methods
default_value(ctx, vars)
click to toggle source
# File lib/bricolage/parameters.rb, line 475 def default_value(ctx, vars) nil end
materialize(name_or_stmt, ctx, vars)
click to toggle source
# File lib/bricolage/parameters.rb, line 479 def materialize(name_or_stmt, ctx, vars) case name_or_stmt when String name = name_or_stmt SQLStatement.new(ctx.parameter_file(expand(name.to_s, vars), 'sql')) when SQLStatement name_or_stmt else raise ParameterError, "unknown type for parameter #{name}: #{name_or_stmt.class}" end end
variables(stmt)
click to toggle source
# File lib/bricolage/parameters.rb, line 491 def variables(stmt) wrap_variable_value(stmt.location) end