Sha256: 79ea3bacb17e1e5e2e857c8584772ee223ec764a7072c1dd070643652d0566b5

Contents?: true

Size: 593 Bytes

Versions: 2

Compression:

Stored size: 593 Bytes

Contents

require 'set'

module Aspect4r
  module Model
    class AspectData < Array
      def initialize klass_or_module
        @group = klass_or_module.hash
      end
      
      def wrapped_methods
        @wrapped_methods ||= {}
      end

      def group_index
        @group_index ||= 0
      end

      def group
        "#{@group}:#{group_index}"
      end

      def change_group
        @group_index = group_index + 1
      end
      
      def advices_for_method method
        method = method.to_s
        select {|advice| advice.method_matcher.match?(method) }
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
aspect4r-0.10.0 lib/aspect4r/model/aspect_data.rb
aspect4r-0.9.1 lib/aspect4r/model/aspect_data.rb