Class: Muesli::Serializers::Base
- Inherits:
-
Object
- Object
- Muesli::Serializers::Base
- Defined in:
- lib/muesli/serializers/base.rb
Class Attribute Summary collapse
-
.whitelisted_attributes ⇒ Object
Returns the value of attribute whitelisted_attributes.
Instance Attribute Summary collapse
-
#model ⇒ Object
Returns the value of attribute model.
-
#user ⇒ Object
Returns the value of attribute user.
Instance Method Summary collapse
-
#initialize(model) ⇒ Base
constructor
A new instance of Base.
- #serialize ⇒ Object
Constructor Details
#initialize(model) ⇒ Base
Returns a new instance of Base.
10 11 12 |
# File 'lib/muesli/serializers/base.rb', line 10 def initialize(model) self.model = model end |
Class Attribute Details
.whitelisted_attributes ⇒ Object
Returns the value of attribute whitelisted_attributes.
5 6 7 |
# File 'lib/muesli/serializers/base.rb', line 5 def whitelisted_attributes @whitelisted_attributes end |
Instance Attribute Details
#model ⇒ Object
Returns the value of attribute model.
8 9 10 |
# File 'lib/muesli/serializers/base.rb', line 8 def model @model end |
#user ⇒ Object
Returns the value of attribute user.
8 9 10 |
# File 'lib/muesli/serializers/base.rb', line 8 def user @user end |
Instance Method Details
#serialize ⇒ Object
14 15 16 |
# File 'lib/muesli/serializers/base.rb', line 14 def serialize return serialize_from_model(self.class.whitelisted_attributes || []) end |