Class: Subledger::Domain::Line
- Inherits:
-
Object
- Object
- Subledger::Domain::Line
- Includes:
- Subledger::Domain, Roles::Attributable, Roles::Collectable, Roles::Creatable, Roles::Describable, Roles::Identifiable, Roles::Readable, Roles::Restable, Roles::Storable, Roles::Timeable, Roles::Versionable, Value
- Defined in:
- lib/subledger/domain/line.rb
Direct Known Subclasses
Defined Under Namespace
Classes: Entity
Instance Attribute Summary collapse
-
#account ⇒ Object
Returns the value of attribute account.
-
#journal_entry ⇒ Object
readonly
Returns the value of attribute journal_entry.
-
#order ⇒ Object
Returns the value of attribute order.
-
#value ⇒ Object
Returns the value of attribute value.
Attributes included from Roles::Versionable
Attributes included from Roles::Storable
Attributes included from Roles::Identifiable
Attributes included from Roles::Describable
Class Method Summary collapse
- .active_klass ⇒ Object
- .archived_klass ⇒ Object
- .posted_klass ⇒ Object
- .root_klass ⇒ Object
- .specialized_raise_unless_creatable(args) ⇒ Object
- .sub_klasses ⇒ Object
- .update(args) ⇒ Object
Instance Method Summary collapse
- #amount ⇒ Object
-
#initialize(args) ⇒ Line
constructor
A new instance of Line.
Methods included from Roles::Restable
#patch_hash, #post_hash, #serializable_hash, #to_json
Methods included from Roles::Collectable
Methods included from Roles::Readable
Methods included from Roles::Creatable
Methods included from Roles::Versionable
Methods included from Roles::Attributable
Methods included from Subledger::Domain
#==, #collection_name, #entity_name, included, #to_s
Methods included from Value
Constructor Details
#initialize(args) ⇒ Line
Returns a new instance of Line.
56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/subledger/domain/line.rb', line 56 def initialize args describable args identifiable args storable args versionable args @journal_entry = args[:journal_entry] @account = args[:account] @value = args[:value] @order = args[:order] specialized_initialization args end |
Instance Attribute Details
#account ⇒ Object
Returns the value of attribute account.
25 26 27 |
# File 'lib/subledger/domain/line.rb', line 25 def account @account end |
#journal_entry ⇒ Object (readonly)
Returns the value of attribute journal_entry.
24 25 26 |
# File 'lib/subledger/domain/line.rb', line 24 def journal_entry @journal_entry end |
#order ⇒ Object
Returns the value of attribute order.
25 26 27 |
# File 'lib/subledger/domain/line.rb', line 25 def order @order end |
#value ⇒ Object
Returns the value of attribute value.
25 26 27 |
# File 'lib/subledger/domain/line.rb', line 25 def value @value end |
Class Method Details
.active_klass ⇒ Object
39 40 41 |
# File 'lib/subledger/domain/line.rb', line 39 def self.active_klass ActiveLine end |
.archived_klass ⇒ Object
35 36 37 |
# File 'lib/subledger/domain/line.rb', line 35 def self.archived_klass ArchivedLine end |
.posted_klass ⇒ Object
43 44 45 |
# File 'lib/subledger/domain/line.rb', line 43 def self.posted_klass PostedLine end |
.root_klass ⇒ Object
27 28 29 |
# File 'lib/subledger/domain/line.rb', line 27 def self.root_klass Line end |
.specialized_raise_unless_creatable(args) ⇒ Object
53 54 |
# File 'lib/subledger/domain/line.rb', line 53 def self.specialized_raise_unless_creatable args end |
.sub_klasses ⇒ Object
31 32 33 |
# File 'lib/subledger/domain/line.rb', line 31 def self.sub_klasses [ archived_klass, active_klass, posted_klass ] end |
.update(args) ⇒ Object
47 48 49 50 51 |
# File 'lib/subledger/domain/line.rb', line 47 def self.update args raise_on_duplicate_orders args super end |
Instance Method Details
#amount ⇒ Object
70 71 72 |
# File 'lib/subledger/domain/line.rb', line 70 def amount value.amount end |