module Fix module Helper module OnHelper def on attribute, *args, &block unless instance_variable_defined? :@object raise MissingSubjectError, "Incomplete specifications. " \ "Please specify a `subject` on the top." end @defs = {} unless instance_variable_defined? :@defs @args = [] unless instance_variable_defined? :@args i = On.new @object, @defs, *(@args + [[attribute] + args]) i.instance_eval(&block) end end end end require_relative File.join '..', 'on'