Class: Pork::Env
- Inherits:
-
Struct
- Object
- Struct
- Pork::Env
- Defined in:
- lib/pork/env.rb
Instance Attribute Summary collapse
-
#after ⇒ Object
Returns the value of attribute after.
-
#before ⇒ Object
Returns the value of attribute before.
-
#super_env ⇒ Object
Returns the value of attribute super_env.
Instance Method Summary collapse
-
#initialize(se = nil) ⇒ Env
constructor
A new instance of Env.
- #run_after(context) ⇒ Object
- #run_before(context) ⇒ Object
Constructor Details
#initialize(se = nil) ⇒ Env
Returns a new instance of Env.
4 5 6 |
# File 'lib/pork/env.rb', line 4 def initialize se=nil super(se, [], []) end |
Instance Attribute Details
#after ⇒ Object
Returns the value of attribute after
3 4 5 |
# File 'lib/pork/env.rb', line 3 def after @after end |
#before ⇒ Object
Returns the value of attribute before
3 4 5 |
# File 'lib/pork/env.rb', line 3 def before @before end |
#super_env ⇒ Object
Returns the value of attribute super_env
3 4 5 |
# File 'lib/pork/env.rb', line 3 def super_env @super_env end |
Instance Method Details
#run_after(context) ⇒ Object
13 14 15 16 |
# File 'lib/pork/env.rb', line 13 def run_after context super_env && super_env.run_after(context) after.each{ |b| context.instance_eval(&b) } end |
#run_before(context) ⇒ Object
8 9 10 11 |
# File 'lib/pork/env.rb', line 8 def run_before context super_env && super_env.run_before(context) before.each{ |b| context.instance_eval(&b) } end |