Sha256: 3ffa59a0eb5b563486693e174913fe78d87082760742b160d3d7ab3b4c4acb10

Contents?: true

Size: 692 Bytes

Versions: 4

Compression:

Stored size: 692 Bytes

Contents

# frozen_string_literal: true

module Hanami
  class Configuration
    class Actions
      # Wrapper for app-level configuration of HTTP cookies for Hanami actions.
      # This decorates the hash of cookie options that is otherwise directly configurable
      # on actions, and adds the `enabled?` method to allow app base action to
      # determine whether to include the `Action::Cookies` module.
      #
      # @since 2.0.0
      class Cookies
        attr_reader :options

        def initialize(options)
          @options = options
        end

        def enabled?
          !options.nil?
        end

        def to_h
          options.to_h
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
hanami-2.0.0.beta3 lib/hanami/configuration/actions/cookies.rb
hanami-2.0.0.beta2 lib/hanami/configuration/actions/cookies.rb
hanami-2.0.0.beta1.1 lib/hanami/configuration/actions/cookies.rb
hanami-2.0.0.beta1 lib/hanami/configuration/actions/cookies.rb