Sha256: d31178b7342b39d6ea76d5256e7a32d091603861008cb44466988ec626ac84e5

Contents?: true

Size: 589 Bytes

Versions: 2

Compression:

Stored size: 589 Bytes

Contents

require File.dirname(__FILE__) + '/../lib/ninja_decorators'

class AfterNinjaSubject
  include NinjaDecorators

  after_filter :common_before, [:foo, :bar, :nested]
  after_filter :nested_before, [:nested]

  attr_accessor :ret

  def initialize
    @ret = ""
  end

  def foo
    @ret += "foo"
  end

  def bar
    @ret += "bar"
  end

  def nested
    @ret += "nested"
  end

  private

  def common_before
    @ret += "common "
    yield if block_given?
    @ret += " around"
  end

  def nested_before
    @ret += "nesting "
    yield if block_given?
    @ret += " completed"
  end
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
haruska-ninja-decorators-0.6.0 test/after_ninja_subject.rb
ninja-decorators-0.6.0 test/after_ninja_subject.rb