Class: FuzzBert::Container
- Inherits:
-
Object
- Object
- FuzzBert::Container
- Includes:
- Generation
- Defined in:
- lib/fuzzbert/container.rb
Instance Method Summary collapse
- #<<(generator) ⇒ Object
-
#initialize(generators = []) ⇒ Container
constructor
A new instance of Container.
- #to_data ⇒ Object
Methods included from Generation
Constructor Details
#initialize(generators = []) ⇒ Container
Returns a new instance of Container.
5 6 7 |
# File 'lib/fuzzbert/container.rb', line 5 def initialize(generators=[]) @generators = generators end |
Instance Method Details
#<<(generator) ⇒ Object
9 10 11 |
# File 'lib/fuzzbert/container.rb', line 9 def <<(generator) @generators << generator end |
#to_data ⇒ Object
13 14 15 16 17 |
# File 'lib/fuzzbert/container.rb', line 13 def to_data "".tap do |buf| @generators.each { |gen| buf << gen.call } end end |