Module: ProjectStore::Entity::Base
- Includes:
- MandatoryProperties
- Defined in:
- lib/project_store/entity/base.rb
Instance Attribute Summary collapse
-
#backing_store ⇒ Object
Returns the value of attribute backing_store.
Attributes included from MandatoryProperties
Instance Method Summary collapse
Methods included from MandatoryProperties
Instance Attribute Details
#backing_store ⇒ Object
Returns the value of attribute backing_store.
8 9 10 |
# File 'lib/project_store/entity/base.rb', line 8 def backing_store @backing_store end |
Instance Method Details
#basic_checks ⇒ Object
23 24 25 26 27 28 29 30 31 |
# File 'lib/project_store/entity/base.rb', line 23 def basic_checks raise PSE, 'Invalid entity. Missing name' unless name raise PSE, 'Invalid entity. You should not specify a name as it would not be taken in account' if self[:name] raise PSE, "Invalid entity '#{name}'. Missing type" unless type raise PSE, "Invalid entity '#{name}'. Forbidden 'backing_store' entry" if self[:backing_store] raise PSE, "Invalid entity '#{name}'. Forbidden 'basic_checks' entry" if self[:basic_checks] raise PSE, "Invalid entity '#{name}'. Forbidden 'save' entry" if self[:save] raise PSE, "Invalid entity '#{name}'. Forbidden 'internal_type' entry" if self[:internal_type] end |
#save ⇒ Object
15 16 17 18 19 20 |
# File 'lib/project_store/entity/base.rb', line 15 def save ProjectStore.logger.info "Saving '#{name}' into '#{backing_store.path}'" backing_store.transaction do backing_store[name] = self end end |