module Kungfuig::ClassMethods
Public Instance Methods
aspect(meth, after = true)
click to toggle source
# File lib/kungfuig.rb, line 134 def aspect meth, after = true fail ArgumentError.new "Aspect must have a codeblock" unless block_given? fail NoMethodError.new "Aspect must be attached to existing method" unless instance_methods.include? meth.to_sym Kungfuig::Prepender.new(self, meth).public_send((after ? :after : :before), &Proc.new).hook! end
aspects()
click to toggle source
# File lib/kungfuig.rb, line 141 def aspects ancestors.select { |a| a.name.nil? && a.ancestors.include?(I★I) } .flat_map { |m| m.instance_methods(false) } .group_by { |e| e } .map { |k, v| [k, v.count] }.to_h end
kungfuigure(&block)
click to toggle source
A wrapper for the configuration block @param block the block to be executed in the context of this module
# File lib/kungfuig.rb, line 130 def kungfuigure &block instance_eval(&block) end