# File lib/monkeybars/view_nesting.rb, line 49 def initialize(nesting_options) super @add_method, @remove_method = if nesting_options[:using].kind_of? Array [nesting_options[:using][0], nesting_options[:using][1]] else [nesting_options[:using], nil] end end
# File lib/monkeybars/view_nesting.rb, line 70 def add(view, nested_view, nested_component, model, transfer) #instance_eval("view.#{@add_method}(@sub_view, model, transfer)") raise NameError.new "Add method not provided for nesting #{self}" if @add_method.nil? || !view.respond_to?(@add_method) view.send(@add_method, nested_view, nested_component, model, transfer) end
# File lib/monkeybars/view_nesting.rb, line 62 def nests_with_add? !@add_method.nil? end
# File lib/monkeybars/view_nesting.rb, line 66 def nests_with_remove? !@remove_method.nil? end
# File lib/monkeybars/view_nesting.rb, line 76 def remove(view, nested_view, nested_component, model, transfer) #instance_eval("view.#{@remove_method}(@sub_view, model, transfer)") raise NameError.new "Remove method not provided for nesting #{self}" if @remove_method.nil? || !view.respond_to?(@remove_method) view.send(@remove_method, nested_view, nested_component, model, transfer) end
Generated with the Darkfish Rdoc Generator 2.