Sha256: 7c6c4beabbdbdb03936cb411025035e55c2b32be428125302935e4c6c2164325

Contents?: true

Size: 337 Bytes

Versions: 1

Compression:

Stored size: 337 Bytes

Contents

module ActionDispatch
  class Request
    class Session
      def fetch(key, *fallback)
        if has_key?(key)
          self.[](key)
        elsif fallback.present?
          fallback
        else
          raise KeyError, "Key not found. Could not find #{key} in session Hash."
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
appdev_support-0.2.1 lib/appdev_support/action_dispatch/request/session/fetch.rb