Class: AssemblyLine::GenericContext
- Inherits:
-
Object
- Object
- AssemblyLine::GenericContext
- Defined in:
- lib/assembly_line/generic_context.rb
Instance Method Summary collapse
-
#before(scope = :each, &block) ⇒ Object
there are no tests so just run the block.
- #clear ⇒ Object
- #let(name, &block) ⇒ Object
Instance Method Details
#before(scope = :each, &block) ⇒ Object
there are no tests so just run the block
12 13 14 |
# File 'lib/assembly_line/generic_context.rb', line 12 def before(scope=:each, &block) instance_eval &block end |
#clear ⇒ Object
16 17 18 19 20 |
# File 'lib/assembly_line/generic_context.rb', line 16 def clear instance_variables.each do |name| instance_variable_set(name, nil) end end |
#let(name, &block) ⇒ Object
4 5 6 7 8 9 |
# File 'lib/assembly_line/generic_context.rb', line 4 def let(name, &block) define_method name do let_values[name] ||= instance_eval(&block) end AssemblyLine.def_delegator :generic_context, name end |