Class: Pork::Env

Inherits:
Struct
  • Object
show all
Defined in:
lib/pork/env.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#afterObject

Returns the value of attribute after

Returns:

  • (Object)

    the current value of after



3
4
5
# File 'lib/pork/env.rb', line 3

def after
  @after
end

#beforeObject

Returns the value of attribute before

Returns:

  • (Object)

    the current value of before



3
4
5
# File 'lib/pork/env.rb', line 3

def before
  @before
end

#super_envObject

Returns the value of attribute super_env

Returns:

  • (Object)

    the current value of 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