Sha256: a5c85bee7eba898082dec12b7a54687756da058a52c62aa51c8dd0a458b096f7

Contents?: true

Size: 702 Bytes

Versions: 19

Compression:

Stored size: 702 Bytes

Contents

# frozen_string_literal: true

require_relative 'value'

module LedgerSync
  module Type
    class ReferenceOne < Value # :nodoc:
      include ValueMixin

      attr_reader :resource_class

      def initialize(resource_class:)
        @resource_class = resource_class
        super()
      end

      def type
        :reference_one
      end

      def resource_classes
        @resource_classes ||= if resource_class.is_a?(Array)
                                resource_class
                              else
                                [resource_class]
                              end
      end

      private

      def valid_classes
        resource_classes
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
ledger_sync-2.6.0 lib/ledger_sync/type/reference_one.rb
ledger_sync-2.5.0 lib/ledger_sync/type/reference_one.rb
ledger_sync-2.4.4 lib/ledger_sync/type/reference_one.rb
ledger_sync-2.3.1 lib/ledger_sync/type/reference_one.rb
ledger_sync-2.2.3 lib/ledger_sync/type/reference_one.rb
ledger_sync-2.2.1 lib/ledger_sync/type/reference_one.rb
ledger_sync-2.2.0 lib/ledger_sync/type/reference_one.rb
ledger_sync-2.0.2 lib/ledger_sync/type/reference_one.rb
ledger_sync-2.0.1 lib/ledger_sync/type/reference_one.rb
ledger_sync-2.0.0 lib/ledger_sync/type/reference_one.rb
ledger_sync-2.0.0.pre.1 lib/ledger_sync/type/reference_one.rb
ledger_sync-1.8.1 lib/ledger_sync/type/reference_one.rb
ledger_sync-1.8.0 lib/ledger_sync/type/reference_one.rb
ledger_sync-1.7.0 lib/ledger_sync/type/reference_one.rb
ledger_sync-1.6.0 lib/ledger_sync/type/reference_one.rb
ledger_sync-1.5.2 lib/ledger_sync/type/reference_one.rb
ledger_sync-1.5.1 lib/ledger_sync/type/reference_one.rb
ledger_sync-1.5.0 lib/ledger_sync/type/reference_one.rb
ledger_sync-1.4.4 lib/ledger_sync/type/reference_one.rb