Class: GreenPepper::SetupExampleFactory
- Inherits:
-
ExampleFactory
- Object
- ExampleFactory
- GreenPepper::SetupExampleFactory
- Defined in:
- lib/greenpepper/factory/setupexamplefactory.rb
Instance Method Summary collapse
Methods inherited from ExampleFactory
Instance Method Details
#create_example(table) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/greenpepper/factory/setupexamplefactory.rb', line 12 def create_example(table) return nil unless support? table example = SetupExample.new table[0][1], NameResolver table[1].each{ |header| example.add_header header } table[2..-1].each{ |values| example.add_row values } example end |
#support?(table) ⇒ Boolean
27 28 29 |
# File 'lib/greenpepper/factory/setupexamplefactory.rb', line 27 def support?(table) /^\s*setup\s*$/i === table[0][0] end |