Module: SoftAttributes::Base::ClassMethods

Defined in:
lib/soft_attributes/base.rb

Instance Method Summary collapse

Instance Method Details

#soft_attribute(*args) ⇒ Object



28
29
30
31
32
33
34
35
# File 'lib/soft_attributes/base.rb', line 28

def soft_attribute(*args)
  options = args.extract_options!
  attr = args.first
  options.assert_valid_keys(:include_in_xml, :value)

  __send__(:noop_setter, attr)
  soft_attributes[attr.to_s] = options.slice(:include_in_xml, :value)
end

#soft_attributesObject



37
38
39
# File 'lib/soft_attributes/base.rb', line 37

def soft_attributes
  read_inheritable_attribute(:soft_attributes) || write_inheritable_hash(:soft_attributes, {})
end