Module: LedgerSync::Util::Mixins::ResourceRegisterableMixin::ClassMethods
- Defined in:
- lib/ledger_sync/util/mixins/resource_registerable_mixin.rb
Instance Method Summary collapse
Instance Method Details
#register_resource(resource:) ⇒ Object
8 9 10 11 12 13 14 15 16 |
# File 'lib/ledger_sync/util/mixins/resource_registerable_mixin.rb', line 8 def register_resource(resource:) if resources.is_a?(Hash) raise "Resource key #{resource.resource_type} already exists." if resources.key?(resource.resource_type) resources[resource.resource_type] = resource else resources << resource end end |
#resources ⇒ Object
18 19 20 |
# File 'lib/ledger_sync/util/mixins/resource_registerable_mixin.rb', line 18 def resources @resources ||= [] end |