Sha256: ba1e607e53e0f26e399d27ba8abca04036b5a5c613bdce07d5275d7b4e06f268

Contents?: true

Size: 661 Bytes

Versions: 3

Compression:

Stored size: 661 Bytes

Contents

module Riot
  module ContextOptions

    # Set options for the specific context. These options will generally be used for context middleware.
    # Riot::Context does not currently look at any options.
    #
    #   context "Foo" do
    #     set :transactional, true
    #   end
    def set(key, value) options[key] = value; end

    # Returns the value of a set option. The key must match exactly, symbols and strings are not
    # interchangeable.
    #
    # @return [Object]
    def option(key) options[key]; end

    # Returns the has of defined options.
    #
    # @return [Hash]
    def options; @options ||= {}; end

  end # ContextOptions
end # Riot

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
riot-0.12.1 lib/riot/context_options.rb
riot-0.12.0 lib/riot/context_options.rb
riot-0.12.0.pre lib/riot/context_options.rb