Sha256: f4de7c68bc846a7156a8fb0ee6db667b3af7bf16b543370673f849bab4401d92

Contents?: true

Size: 407 Bytes

Versions: 25

Compression:

Stored size: 407 Bytes

Contents

# frozen_string_literal: true

module WorkOS
  # Module to include an explicit method for converting a model into a Hash containing
  # its attributes. Default implementation will simply call to_json. Individual classes
  # may override.
  module HashProvider
    include Kernel

    def to_json(*)
      raise 'Must be implemented by including class.'
    end

    def to_h
      to_json
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
workos-5.15.0 lib/workos/hash_provider.rb
workos-5.14.0 lib/workos/hash_provider.rb
workos-5.13.0 lib/workos/hash_provider.rb
workos-5.12.0 lib/workos/hash_provider.rb
workos-5.11.1 lib/workos/hash_provider.rb
workos-5.11.0 lib/workos/hash_provider.rb
workos-5.10.0 lib/workos/hash_provider.rb
workos-5.9.0 lib/workos/hash_provider.rb
workos-5.8.0 lib/workos/hash_provider.rb
workos-5.7.0 lib/workos/hash_provider.rb
workos-5.6.0 lib/workos/hash_provider.rb
workos-5.5.1 lib/workos/hash_provider.rb
workos-5.5.0 lib/workos/hash_provider.rb
workos-5.4.0 lib/workos/hash_provider.rb
workos-5.3.0 lib/workos/hash_provider.rb
workos-5.2.1 lib/workos/hash_provider.rb
workos-5.2.0 lib/workos/hash_provider.rb
workos-5.1.0 lib/workos/hash_provider.rb
workos-5.0.0 lib/workos/hash_provider.rb
workos-4.8.0 lib/workos/hash_provider.rb