Module: NoIntegrity::ClassMethods
- Defined in:
- lib/no_integrity/no_integrity.rb
Instance Method Summary collapse
- #no_attr_store(storage_attribute = nil) ⇒ Object
- #no_attribute(options) ⇒ Object
- #no_attribute_mappings ⇒ Object
- #no_attributes ⇒ Object
Instance Method Details
#no_attr_store(storage_attribute = nil) ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/no_integrity/no_integrity.rb', line 10 def no_attr_store(storage_attribute = nil) if storage_attribute && @no_attr_store.nil? alias_no_attr_store(storage_attribute) @no_attr_store = storage_attribute end return @no_attr_store end |
#no_attribute(options) ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/no_integrity/no_integrity.rb', line 23 def no_attribute() @no_attributes ||= { } if .is_a?(Hash) .keys.each do |attrib| @no_attributes[attrib] = [attrib] setup_no_attribute_accessors(attrib, [attrib]) update_no_attribute_mappings(attrib, [attrib]) end elsif .is_a?(Array) .each do |attrib| @no_attributes[attrib] = nil setup_no_attribute_accessors(attrib, nil) end elsif .is_a?(Symbol) setup_no_attribute_accessors() end end |
#no_attribute_mappings ⇒ Object
41 42 43 |
# File 'lib/no_integrity/no_integrity.rb', line 41 def no_attribute_mappings @no_attribute_mappings end |
#no_attributes ⇒ Object
19 20 21 |
# File 'lib/no_integrity/no_integrity.rb', line 19 def no_attributes @no_attributes || { } end |