Sha256: ec09b1e3a72b0c763db0e63de36aa26d52da68d48c3457d3cecbd936a99a347a

Contents?: true

Size: 548 Bytes

Versions: 2

Compression:

Stored size: 548 Bytes

Contents

# frozen_string_literal: true

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

      def cast?
        true
      end

      def changed_in_place?(raw_old_value, new_value)
        raw_old_value != new_value if new_value.is_a?(::Hash)
      end

      def type
        :id
      end

      def valid_classes
        [::Hash]
      end

      private

      def cast_value(value)
        case value
        when ::Hash then value.clone
        else { value: valuev}
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ledger_sync-1.3.5 lib/ledger_sync/type/hash.rb
ledger_sync-1.3.4 lib/ledger_sync/type/hash.rb