Class: Bricolage::Parameters::Declarations
- Inherits:
-
Object
- Object
- Bricolage::Parameters::Declarations
- Defined in:
- lib/bricolage/parameters.rb
Overview
Job parameter declarations defined by job class.
Instance Method Summary collapse
- #[](key) ⇒ Object
- #add(param) ⇒ Object
- #each(&block) ⇒ Object
-
#initialize ⇒ Declarations
constructor
A new instance of Declarations.
- #inspect ⇒ Object
- #keys ⇒ Object
- #parse_default_values(values) ⇒ Object
- #parse_direct_values(values) ⇒ Object
- #parsing_options {|h| ... } ⇒ Object
- #union_intermediate_values(*ival_list) ⇒ Object
Constructor Details
#initialize ⇒ Declarations
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 |
#inspect ⇒ Object
17 18 19 |
# File 'lib/bricolage/parameters.rb', line 17 def inspect "\#<#{self.class} #{@decls.inspect}>" end |
#keys ⇒ Object
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
46 47 48 49 50 |
# File 'lib/bricolage/parameters.rb', line 46 def 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 |