Class: Subledger::Domain::ActiveCategory
- Defined in:
- lib/subledger/domain/category.rb
Defined Under Namespace
Classes: Entity
Instance Attribute Summary
Attributes inherited from Category
Attributes included from Roles::Versionable
Attributes included from Roles::Storable
Attributes included from Roles::Identifiable
Attributes included from Roles::Describable
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Category
#accounts, active_klass, archived_klass, #initialize, patch_keys, post_keys, root_klass
Methods included from Roles::Restable
#patch_hash, #post_hash, #serializable_hash, #to_json
Methods included from Roles::Archivable
Methods included from Roles::Activatable
Methods included from Roles::Collectable
Methods included from Roles::Updatable
Methods included from Roles::Readable
Methods included from Roles::Creatable
Methods included from Roles::Versionable
Methods included from Roles::Storable
Methods included from Roles::Describable
Methods included from Roles::Attributable
Methods included from Subledger::Domain
#==, #collection_name, #entity_name, included, #to_s
Constructor Details
This class inherits a constructor from Subledger::Domain::Category
Class Method Details
.sub_klasses ⇒ Object
126 127 128 |
# File 'lib/subledger/domain/category.rb', line 126 def self.sub_klasses [ active_klass ] end |
Instance Method Details
#attach(args) ⇒ Object
130 131 132 133 134 135 136 137 138 139 140 141 |
# File 'lib/subledger/domain/category.rb', line 130 def attach args account = args[:account] begin store.attach_account_to_category :category => self, :account => account rescue Store::AttachError => e raise CategoryError, e end account end |
#detach(args) ⇒ Object
143 144 145 146 147 148 149 150 151 152 153 154 |
# File 'lib/subledger/domain/category.rb', line 143 def detach args account = args[:account] begin store.detach_account_from_category :category => self, :account => account rescue Store::DetachError => e raise CategoryError, e end account end |