Sha256: 551e87a032d1a7a809c90d8394714ccbd328f86bdde3399ea09d2ef34aa6af1f

Contents?: true

Size: 772 Bytes

Versions: 6

Compression:

Stored size: 772 Bytes

Contents

module {{namespace_module}}
  module {{resource_module}}
    module Update
      class Normalizer
        include Shogun::Normalizer
        include {{resource_module}}

        METADATA = %w|id|
        ATTRIBUTES = %w|attirbute|

        def initialize(raw:)
          @id = raw["id"]

          if raw["rack.authentication"] && raw["rack.authentication"]["sessions"]
            @session = raw["rack.authentication"]["sessions"]["id"]
          end

          if raw[NAMESPACE]
            @attribute = raw[namespace]["attribute"]
          end
        end

        def id
          @id
        end

        def session
          @session
        end

        def attribute
          @attribute.strip if @attribute.is_a?(String)
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
shogun-6.4.2 scaffold/generate/resource/update/normalizer.rb
shogun-6.4.1 scaffold/generate/resource/update/normalizer.rb
shogun-6.4.0 scaffold/generate/resource/update/normalizer.rb
shogun-6.3.0 scaffold/generate/resource/update/normalizer.rb
shogun-6.2.3 scaffold/generate/resource/update/normalizer.rb
shogun-6.2.2 scaffold/generate/resource/update/normalizer.rb