Module: SoftAttributes::NoopSetter

Defined in:
lib/soft_attributes/noop_setter.rb

Class Method Summary collapse

Class Method Details

.included(mod) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/soft_attributes/noop_setter.rb', line 3

def self.included(mod)
  mod.module_eval do
    class << self
      def noop_setter(*attrs)
        attrs.flatten.each do |attr|
          send(:define_method, "#{attr}=") {|ignore|}
        end
      end
    end
  end
end