Module: DomainDriven::Model
- Defined in:
- lib/domain_driven/model.rb
Overview
Include in ActiveRecord models to mimic Entity models.
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.included(klass) ⇒ Object
38 39 40 41 |
# File 'lib/domain_driven/model.rb', line 38 def self.included(klass) super klass.extend ClassMethods end |
Instance Method Details
#==(other) ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/domain_driven/model.rb', line 17 def ==(other) if other.respond_to?(:entity?) && other.entity? self == other._data else super end end |
#_data ⇒ Object
9 10 11 |
# File 'lib/domain_driven/model.rb', line 9 def _data self end |
#entity? ⇒ Boolean
13 14 15 |
# File 'lib/domain_driven/model.rb', line 13 def entity? false end |