Flowdock
method

adv_attr_accessor

Importance_0
v3.0.5 - Show latest stable - 0 notes - Class: ActionMailer::AdvAttrAccessor
adv_attr_accessor(*names) public

No documentation

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

Hide source
# File actionmailer/lib/action_mailer/adv_attr_accessor.rb, line 3
    def adv_attr_accessor(*names)
      names.each do |name|
        ivar = "@#{name}"

        class_eval "def \#{name}=(value)\n\#{ivar} = value\nend\n\ndef \#{name}(*args)\nraise ArgumentError, \"expected 0 or 1 parameters\" unless args.length <= 1\nif args.empty?\n\#{ivar} if instance_variable_names.include?(\#{ivar.inspect})\nelse\n\#{ivar} = args.first\nend\nend\n", __FILE__, __LINE__ + 1

        self.protected_instance_variables << ivar if self.respond_to?(:protected_instance_variables)
      end
    end
Register or log in to add new notes.