Class: Bricolage::Parameters::Declarations

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

Overview

Job parameter declarations defined by job class.

Instance Method Summary collapse

Constructor Details

#initializeDeclarations

Returns a new instance of Declarations.



13
14
15
# File 'lib/bricolage/parameters.rb', line 13

def initialize
  @decls = {}   # {name => Param}
end

Instance Method Details

#[](key) ⇒ Object



25
26
27
# File 'lib/bricolage/parameters.rb', line 25

def [](key)
  @decls[key]
end

#add(param) ⇒ Object



21
22
23
# File 'lib/bricolage/parameters.rb', line 21

def add(param)
  @decls[param.name] = param
end

#each(&block) ⇒ Object



33
34
35
# File 'lib/bricolage/parameters.rb', line 33

def each(&block)
  @decls.each_value(&block)
end

#inspectObject



17
18
19
# File 'lib/bricolage/parameters.rb', line 17

def inspect
  "\#<#{self.class} #{@decls.inspect}>"
end

#keysObject



29
30
31
# File 'lib/bricolage/parameters.rb', line 29

def keys
  @decls.keys
end

#parse_default_values(values) ⇒ Object



37
38
39
40
# File 'lib/bricolage/parameters.rb', line 37

def parse_default_values(values)
  return IntermediateValues.empty(self) unless values
  DefaultValuesHandler.new(self).parse(values)
end

#parse_direct_values(values) ⇒ Object



42
43
44
# File 'lib/bricolage/parameters.rb', line 42

def parse_direct_values(values)
  DirectValueHandler.new(self).parse(values)
end

#parsing_options {|h| ... } ⇒ Object

Yields:

  • (h)


46
47
48
49
50
# File 'lib/bricolage/parameters.rb', line 46

def parsing_options
  h = CommandLineOptionHandler.new(self)
  yield h
  h.values
end

#union_intermediate_values(*ival_list) ⇒ Object



52
53
54
# File 'lib/bricolage/parameters.rb', line 52

def union_intermediate_values(*ival_list)
  IntermediateValues.union(self, *ival_list)
end