Class: LedgerSync::ResourceAttribute::Reference::Many
- Inherits:
-
LedgerSync::ResourceAttribute::Reference
- Object
- LedgerSync::ResourceAttribute
- LedgerSync::ResourceAttribute::Reference
- LedgerSync::ResourceAttribute::Reference::Many
- Defined in:
- lib/ledger_sync/resource_attribute/reference/many.rb
Defined Under Namespace
Modules: Mixin Classes: ManyArray
Instance Attribute Summary
Attributes inherited from LedgerSync::ResourceAttribute
#name, #reference, #resource_class, #type, #value
Instance Method Summary collapse
- #changed? ⇒ Boolean
- #changes ⇒ Object
-
#initialize(args = {}) ⇒ Many
constructor
A new instance of Many.
- #save ⇒ Object
Methods inherited from LedgerSync::ResourceAttribute
#assert_valid, #cast, #reference?, #references_many?, #valid_with?, #will_change?
Methods included from Util::Mixins::DupableMixin
Constructor Details
#initialize(args = {}) ⇒ Many
Returns a new instance of Many.
62 63 64 65 66 67 68 69 70 |
# File 'lib/ledger_sync/resource_attribute/reference/many.rb', line 62 def initialize(args = {}) to = args.fetch(:to) super( args.except(:to).merge( type: Type::ReferenceMany.new(resource_class: to), value: ManyArray.new ) ) end |
Instance Method Details
#changed? ⇒ Boolean
72 73 74 |
# File 'lib/ledger_sync/resource_attribute/reference/many.rb', line 72 def changed? value.changed? end |
#changes ⇒ Object
76 77 78 |
# File 'lib/ledger_sync/resource_attribute/reference/many.rb', line 76 def changes value.changes end |
#save ⇒ Object
80 81 82 |
# File 'lib/ledger_sync/resource_attribute/reference/many.rb', line 80 def save value.save end |