Sha256: 3234b6f6396b320701e5a2639f73449a902dfe51f1ccd2b1011fb63681abce7b

Contents?: true

Size: 572 Bytes

Versions: 2

Compression:

Stored size: 572 Bytes

Contents

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

class AroundNinjaSubject
  include NinjaDecorators

  around_filter :common_around, [:foo, :bar, :nested]
  around_filter :nested_around, [: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_around
    @ret += "common "
    yield
    @ret += " around"
  end
  
  def nested_around
    @ret += "nesting "
    yield
    @ret += " completed"
  end
end

Version data entries

2 entries across 2 versions & 2 rubygems

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