Sha256: cf2197d7c63a35bf89141d01c3213f01034fbea6b33b662aceeed42287261b47
Contents?: true
Size: 896 Bytes
Versions: 11
Compression:
Stored size: 896 Bytes
Contents
module Aspector class MethodMatcher def initialize *match_data @match_data = match_data @match_data.flatten! end def match? method, aspect = nil @match_data.detect do |item| case item when String item == method when Regexp item =~ method when Symbol item.to_s == method when DeferredLogic value = aspect.aop_deferred_logic_results(item) if value new_matcher = MethodMatcher.new(value) new_matcher.match?(method) end when DeferredOption value = aspect.send(:aop_options)[item.key] if value new_matcher = MethodMatcher.new(value) new_matcher.match?(method) end end end end def to_s @match_data.map {|item| item.inspect }.join ", " end end end
Version data entries
11 entries across 11 versions & 1 rubygems