Module: Riot::ContextOptions

Included in:
Context
Defined in:
lib/riot/context_options.rb

Instance Method Summary collapse

Instance Method Details

#option(key) ⇒ Object

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

Returns:



16
# File 'lib/riot/context_options.rb', line 16

def option(key) options[key]; end

#optionsHash

Returns the has of defined options.

Returns:

  • (Hash)


21
# File 'lib/riot/context_options.rb', line 21

def options; @options ||= {}; end

#set(key, value) ⇒ Object

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


10
# File 'lib/riot/context_options.rb', line 10

def set(key, value) options[key] = value; end