Class: Locomotive::Mounter::Models::Base

Inherits:
Object
  • Object
show all
Includes:
Fields
Defined in:
lib/locomotive/mounter/models/base.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#_idObject

Returns the value of attribute _id.



9
10
11
# File 'lib/locomotive/mounter/models/base.rb', line 9

def _id
  @_id
end

#created_atObject

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_pointObject

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_atObject

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

Returns:

  • (Boolean)


19
20
21
# File 'lib/locomotive/mounter/models/base.rb', line 19

def persisted?
	!self._id.blank?
end