Class: Subledger::Domain::Org

Direct Known Subclasses

ActiveOrg, ArchivedOrg

Defined Under Namespace

Classes: Entity

Instance Attribute Summary collapse

Attributes included from Roles::Versionable

#version

Attributes included from Roles::Storable

#client, #store

Attributes included from Roles::Identifiable

#id

Attributes included from Roles::Describable

#description, #reference

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Roles::Restable

#patch_hash, #post_hash, #serializable_hash, #to_json

Methods included from Roles::Archivable

#archive

Methods included from Roles::Activatable

#activate

Methods included from Roles::Updatable

included, #update

Methods included from Roles::Readable

included, #read

Methods included from Roles::Creatable

#create, included

Methods included from Roles::Versionable

included

Methods included from Roles::Attributable

#attributes

Methods included from Subledger::Domain

#==, #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_nameObject

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_klassObject



42
43
44
# File 'lib/subledger/domain/org.rb', line 42

def self.active_klass
  ActiveOrg
end

.archived_klassObject



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_keysObject



34
35
36
# File 'lib/subledger/domain/org.rb', line 34

def self.patch_keys
  [ :id, :description, :reference, :bucket_name, :version ]
end

.post_keysObject



30
31
32
# File 'lib/subledger/domain/org.rb', line 30

def self.post_keys
  [ :description, :reference, :bucket_name ]
end

.root_klassObject



26
27
28
# File 'lib/subledger/domain/org.rb', line 26

def self.root_klass
  Org
end

.sub_klassesObject



38
39
40
# File 'lib/subledger/domain/org.rb', line 38

def self.sub_klasses
  [ active_klass, archived_klass ]
end