Class: Locomotive::Mounter::Models::Base
- Inherits:
-
Object
- Object
- Locomotive::Mounter::Models::Base
- Includes:
- Fields
- Defined in:
- lib/locomotive/mounter/models/base.rb
Direct Known Subclasses
ContentAsset, ContentEntry, ContentField, ContentSelectOption, ContentType, EditableElement, Page, Site, Snippet, ThemeAsset, Translation
Instance Attribute Summary collapse
-
#_id ⇒ Object
Returns the value of attribute _id.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#mounting_point ⇒ Object
Returns the value of attribute mounting_point.
-
#updated_at ⇒ Object
Returns the value of attribute updated_at.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Base
constructor
methods ##.
- #persisted? ⇒ Boolean
Methods included from Fields
#[], #attributes, #attributes_with_translations, #localized_field?, #to_hash, #to_yaml, #translated_in, #translated_in?, #write_attributes
Constructor Details
#initialize(attributes = {}) ⇒ Base
methods ##
13 14 15 16 17 |
# File 'lib/locomotive/mounter/models/base.rb', line 13 def initialize(attributes = {}) self.created_at = self.updated_at = Time.now self.mounting_point = attributes.delete(:mounting_point) super end |
Instance Attribute Details
#_id ⇒ Object
Returns the value of attribute _id.
9 10 11 |
# File 'lib/locomotive/mounter/models/base.rb', line 9 def _id @_id end |
#created_at ⇒ Object
Returns the value of attribute created_at.
9 10 11 |
# File 'lib/locomotive/mounter/models/base.rb', line 9 def created_at @created_at end |
#mounting_point ⇒ Object
Returns the value of attribute mounting_point.
9 10 11 |
# File 'lib/locomotive/mounter/models/base.rb', line 9 def mounting_point @mounting_point end |
#updated_at ⇒ Object
Returns the value of attribute updated_at.
9 10 11 |
# File 'lib/locomotive/mounter/models/base.rb', line 9 def updated_at @updated_at end |
Instance Method Details
#persisted? ⇒ Boolean
19 20 21 |
# File 'lib/locomotive/mounter/models/base.rb', line 19 def persisted? !self._id.blank? end |