Class: Bricolage::DestTableParam

Inherits:
Param
  • Object
show all
Defined in:
lib/bricolage/parameters.rb

Instance Attribute Summary

Attributes inherited from Param

#arg_spec, #description, #name

Instance Method Summary collapse

Methods inherited from Param

#have_arg?, #inspect, #option_name, #optional?, #parse_option_value, #parse_value, #publish?, #required?

Constructor Details

#initialize(name = 'dest-table', arg_spec = '[SCHEMA.]TABLE', description = 'Target table name.', optional: true, publish: true) ⇒ DestTableParam

Returns a new instance of DestTableParam.



497
498
499
500
501
502
503
504
505
506
507
# File 'lib/bricolage/parameters.rb', line 497

def initialize(
    name = 'dest-table',
    arg_spec = '[SCHEMA.]TABLE',
    description = 'Target table name.',
    # [CLUDGE] Default dest_table is provided by SQL parameter declarations,
    # we cannot require the value here.  I know this is bad...
    optional: true,
    publish: true
)
  super name, arg_spec, description, optional: optional, publish: publish
end

Instance Method Details

#default_value(ctx, vars) ⇒ Object



509
510
511
# File 'lib/bricolage/parameters.rb', line 509

def default_value(ctx, vars)
  nil
end

#materialize(spec, ctx, vars) ⇒ Object



513
514
515
# File 'lib/bricolage/parameters.rb', line 513

def materialize(spec, ctx, vars)
  TableSpec.parse(expand(spec, vars))
end

#variables(spec) ⇒ Object



517
518
519
# File 'lib/bricolage/parameters.rb', line 517

def variables(spec)
  wrap_variable_value(spec.to_s)
end