Flowdock
method

register_detail

Importance_0
v3.2.3 - Show latest stable - 0 notes - Class: ActionView::LookupContext
register_detail(name, options = {}, &block) public

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File actionpack/lib/action_view/lookup_context.rb, line 21
    def self.register_detail(name, options = {}, &block)
      self.registered_details << name
      initialize = registered_details.map { |n| "@details[:#{n}] = details[:#{n}] || default_#{n}" }

      Accessors.send :define_method, :"default_#{name}", &block
      Accessors.module_eval         def #{name}          @details[:#{name}]        end        def #{name}=(value)          value = value.present? ? Array.wrap(value) : default_#{name}          _set_detail(:#{name}, value) if value != @details[:#{name}]        end        remove_possible_method :initialize_details        def initialize_details(details)          #{initialize.join("\n")}        end, __FILE__, __LINE__ + 1
    end
Register or log in to add new notes.