Sha256: a3055aebdc5314e99e2d2d55abe31b62ab20fbd5ef371810d11e135bebf2a4c9

Contents?: true

Size: 455 Bytes

Versions: 1

Compression:

Stored size: 455 Bytes

Contents

# frozen_string_literal: true

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 valid_without_casting?(value:)
        return true if value.is_a?(resource_class)

        false
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ledger_sync-1.1.1 lib/ledger_sync/type/reference_one.rb