module Riot::ContextOptions

Public Instance Methods

option(key) click to toggle source

Returns the value of a set option. The key must match exactly, symbols and strings are not interchangeable.

@param [Object] key the key used to look up the option value @return [Object]

# File lib/riot/context_options.rb, line 22
def option(key)
  option_set[key]
end
option_set() click to toggle source

Returns the hash of defined options.

@return [Hash]

# File lib/riot/context_options.rb, line 29
def option_set
  @options ||= {}
end
set(key, value) click to toggle source

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

@param [Object] key the key used to look up the option value later @param [Object] value the option value to store

# File lib/riot/context_options.rb, line 13
def set(key, value)
  option_set[key] = value
end