Sha256: d93caa9fc44bf8bf4f1c3ee07245f0a9d56a2e09e6bddf2313db17db2f6359e6

Contents?: true

Size: 661 Bytes

Versions: 6

Compression:

Stored size: 661 Bytes

Contents

module {{namespace_module}}
  module Sessions
    module Destroy
      class Denormalizer
        include Shogun::Denormalizer
        include Sessions

        MAPPING = {
          "token" => "token",
          "created_at" => "created_at",
          "destroyed_at" => "destroyed_at"
        }

        def initialize(object:)
          @object = object
          @meta = object.meta
          @links = object.links
          @linked = object.linked
        end

        private def document
          mapping.inject({}) do |hash, (field, name)|
            hash.merge(field => @object.public_send(name))
          end
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
shogun-6.4.2 scaffold/new/project/lib/namespace/sessions/destroy/denormalizer.rb
shogun-6.4.1 scaffold/new/project/lib/namespace/sessions/destroy/denormalizer.rb
shogun-6.4.0 scaffold/new/project/lib/namespace/sessions/destroy/denormalizer.rb
shogun-6.3.0 scaffold/new/project/lib/namespace/sessions/destroy/denormalizer.rb
shogun-6.2.3 scaffold/new/project/lib/namespace/sessions/destroy/denormalizer.rb
shogun-6.2.2 scaffold/new/project/lib/namespace/sessions/destroy/denormalizer.rb