Sha256: 028eb512fc175a00d5af44c158a4e4449a9e63f22a6b5a81028b34279fabe82c

Contents?: true

Size: 855 Bytes

Versions: 6

Compression:

Stored size: 855 Bytes

Contents

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

        MAPPING = {
          "id" => "id",
          "signature" => "signature",
          "username" => "username",
          "email" => "email",
          "name" => "name",
          "created_at" => "created_at",
          "destroyed_at" => "destroyed_at",
          "updated_at" => "updated_at",
          "href" => "href"
        }

        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/accounts/destroy/denormalizer.rb
shogun-6.4.1 scaffold/new/project/lib/namespace/accounts/destroy/denormalizer.rb
shogun-6.4.0 scaffold/new/project/lib/namespace/accounts/destroy/denormalizer.rb
shogun-6.3.0 scaffold/new/project/lib/namespace/accounts/destroy/denormalizer.rb
shogun-6.2.3 scaffold/new/project/lib/namespace/accounts/destroy/denormalizer.rb
shogun-6.2.2 scaffold/new/project/lib/namespace/accounts/destroy/denormalizer.rb