Class: Config::Complex
- Inherits:
-
ComplexItem
- Object
- Item
- ComplexItem
- Config::Complex
- Defined in:
- lib/module_config/items/complex.rb
Constant Summary collapse
- @@subitemregex =
/\A.*\Z/
Instance Attribute Summary
Attributes inherited from ComplexItem
Attributes inherited from Item
Instance Method Summary collapse
-
#initialize(_str, _regex) ⇒ Complex
constructor
A new instance of Complex.
- #print ⇒ Object
Methods inherited from ComplexItem
Methods inherited from Item
Constructor Details
#initialize(_str, _regex) ⇒ Complex
Returns a new instance of Complex.
28 29 30 31 32 33 34 |
# File 'lib/module_config/items/complex.rb', line 28 def initialize(_str, _regex) super(_str, _regex) @value.each do |item| item.strip! raise ConfigWrongFormatException.new(self.class), "Configuration subitem <#{item}> of item <#{name}> has wrong format." unless item =~ @@subitemregex end end |
Instance Method Details
#print ⇒ Object
36 37 38 39 40 41 |
# File 'lib/module_config/items/complex.rb', line 36 def print puts " #{@name} = { ##{self.class.to_s}" $stdout.print " " puts @value.join(";\n ") puts " }" end |