Class: Pigtail::Output::Config
- Inherits:
-
Object
- Object
- Pigtail::Output::Config
- Defined in:
- lib/pigtail/output_config.rb
Instance Attribute Summary collapse
-
#configure ⇒ Object
Returns the value of attribute configure.
-
#path ⇒ Object
Returns the value of attribute path.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(path = nil, configure = nil) ⇒ Config
constructor
A new instance of Config.
- #output ⇒ Object
Constructor Details
#initialize(path = nil, configure = nil) ⇒ Config
Returns a new instance of Config.
6 7 8 9 |
# File 'lib/pigtail/output_config.rb', line 6 def initialize(path = nil, configure = nil) @path = path @configure = configure end |
Instance Attribute Details
#configure ⇒ Object
Returns the value of attribute configure.
4 5 6 |
# File 'lib/pigtail/output_config.rb', line 4 def configure @configure end |
#path ⇒ Object
Returns the value of attribute path.
4 5 6 |
# File 'lib/pigtail/output_config.rb', line 4 def path @path end |
Class Method Details
.enumerate(item) ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/pigtail/output_config.rb', line 11 def self.enumerate(item) if item and item.is_a?(String) items = item.split(',') else items = item items = [items] unless items and items.respond_to?(:each) end items end |
.output(paths, config) ⇒ Object
21 22 23 24 25 |
# File 'lib/pigtail/output_config.rb', line 21 def self.output(paths, config) enumerate(paths).each do |path| yield new(path, config.output).output end end |
Instance Method Details
#output ⇒ Object
27 28 29 |
# File 'lib/pigtail/output_config.rb', line 27 def output { path: @path, configure: @configure } end |