Sha256: 389f7738b89af48307d9a326130559bbbb514f64051c63a627c80953e11ac672

Contents?: true

Size: 421 Bytes

Versions: 22

Compression:

Stored size: 421 Bytes

Contents

# frozen_string_literal: true
# typed: 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

22 entries across 22 versions & 1 rubygems

Version Path
workos-4.1.0 lib/workos/hash_provider.rb
workos-4.0.0 lib/workos/hash_provider.rb
workos-3.1.0 lib/workos/hash_provider.rb
workos-3.0.0 lib/workos/hash_provider.rb
workos-2.17.0 lib/workos/hash_provider.rb
workos-2.16.0 lib/workos/hash_provider.rb
workos-2.15.0 lib/workos/hash_provider.rb
workos-2.14.0 lib/workos/hash_provider.rb
workos-2.13.0 lib/workos/hash_provider.rb
workos-2.12.1 lib/workos/hash_provider.rb
workos-2.12.0 lib/workos/hash_provider.rb
workos-2.11.0 lib/workos/hash_provider.rb
workos-2.10.0 lib/workos/hash_provider.rb
workos-2.9.0 lib/workos/hash_provider.rb
workos-2.8.0 lib/workos/hash_provider.rb
workos-2.7.0 lib/workos/hash_provider.rb
workos-2.6.0 lib/workos/hash_provider.rb
workos-2.5.1 lib/workos/hash_provider.rb
workos-2.5.0 lib/workos/hash_provider.rb
workos-2.4.0 lib/workos/hash_provider.rb