Class: Subledger::Domain::Org
- Inherits:
-
Object
- Object
- Subledger::Domain::Org
show all
- Includes:
- Subledger::Domain, Roles::Activatable, Roles::Archivable, Roles::Attributable, Roles::Creatable, Roles::Describable, Roles::Identifiable, Roles::Readable, Roles::Restable, Roles::Storable, Roles::Updatable, Roles::Versionable
- Defined in:
- lib/subledger/domain/org.rb
Defined Under Namespace
Classes: Entity
Instance Attribute Summary collapse
#version
#client, #store
#id
#description, #reference
Class Method Summary
collapse
Instance Method Summary
collapse
#patch_hash, #post_hash, #serializable_hash, #to_json
#archive
#activate
included, #update
included, #read
#create, included
included
#attributes
#==, #collection_name, #entity_name, included, #to_s
Constructor Details
#initialize(args) ⇒ Org
Returns a new instance of Org.
58
59
60
61
62
63
64
65
|
# File 'lib/subledger/domain/org.rb', line 58
def initialize args
describable args
identifiable args
storable args
versionable args
@bucket_name = args[:bucket_name]
end
|
Instance Attribute Details
#bucket_name ⇒ Object
Returns the value of attribute bucket_name.
24
25
26
|
# File 'lib/subledger/domain/org.rb', line 24
def bucket_name
@bucket_name
end
|
Class Method Details
.active_klass ⇒ Object
42
43
44
|
# File 'lib/subledger/domain/org.rb', line 42
def self.active_klass
ActiveOrg
end
|
.archived_klass ⇒ Object
46
47
48
|
# File 'lib/subledger/domain/org.rb', line 46
def self.archived_klass
ArchivedOrg
end
|
.create(args) ⇒ Object
50
51
52
53
54
55
56
|
# File 'lib/subledger/domain/org.rb', line 50
def self.create args
org = super
args[:store].add_initial_controls_for org
org
end
|
.patch_keys ⇒ Object
34
35
36
|
# File 'lib/subledger/domain/org.rb', line 34
def self.patch_keys
[ :id, :description, :reference, :bucket_name, :version ]
end
|
.post_keys ⇒ Object
30
31
32
|
# File 'lib/subledger/domain/org.rb', line 30
def self.post_keys
[ :description, :reference, :bucket_name ]
end
|
.root_klass ⇒ Object
26
27
28
|
# File 'lib/subledger/domain/org.rb', line 26
def self.root_klass
Org
end
|
.sub_klasses ⇒ Object
38
39
40
|
# File 'lib/subledger/domain/org.rb', line 38
def self.sub_klasses
[ active_klass, archived_klass ]
end
|