Module: Muffin::Attributes
- Included in:
- Base, NestedAttribute
- Defined in:
- lib/muffin/frostings/attributes.rb
Defined Under Namespace
Modules: ClassMethods
Constant Summary collapse
Instance Attribute Summary collapse
-
#attributes ⇒ Object
Returns the value of attribute attributes.
Class Method Summary collapse
Instance Method Summary collapse
- #assign_attributes ⇒ Object
- #persisted? ⇒ Boolean
-
#respond_to_missing?(method_name, include_private = false) ⇒ Boolean
fields_for checks wether an object responds to [foo_attributes=].
Instance Attribute Details
#attributes ⇒ Object
Returns the value of attribute attributes.
41 42 43 |
# File 'lib/muffin/frostings/attributes.rb', line 41 def attributes @attributes end |
Class Method Details
.included(base) ⇒ Object
53 54 55 |
# File 'lib/muffin/frostings/attributes.rb', line 53 def self.included(base) base.extend ClassMethods end |
Instance Method Details
#assign_attributes ⇒ Object
49 50 51 |
# File 'lib/muffin/frostings/attributes.rb', line 49 def assign_attributes self.attributes = params end |
#persisted? ⇒ Boolean
57 58 59 |
# File 'lib/muffin/frostings/attributes.rb', line 57 def persisted? attributes[:id].present? end |
#respond_to_missing?(method_name, include_private = false) ⇒ Boolean
fields_for checks wether an object responds to [foo_attributes=]
62 63 64 65 |
# File 'lib/muffin/frostings/attributes.rb', line 62 def respond_to_missing?(method_name, include_private = false) return true if method_name.to_s[/_attributes=\Z/] super end |