Module: Fix::Helper::OnHelper
- Included in:
- On
- Defined in:
- lib/fix/helper/on_helper.rb
Instance Method Summary collapse
Instance Method Details
#on(attribute, *args, &block) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/fix/helper/on_helper.rb', line 4 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 |