Module: Riot::ContextOptions
- Included in:
- Context
- Defined in:
- lib/riot/context_options.rb
Instance Method Summary collapse
-
#option(key) ⇒ Object
Returns the value of a set option.
-
#options ⇒ Hash
Returns the has of defined options.
-
#set(key, value) ⇒ Object
Set options for the specific context.
Instance Method Details
#option(key) ⇒ Object
Returns the value of a set option. The key must match exactly, symbols and strings are not interchangeable.
16 |
# File 'lib/riot/context_options.rb', line 16 def option(key) [key]; end |
#options ⇒ Hash
Returns the has of defined options.
21 |
# File 'lib/riot/context_options.rb', line 21 def ; @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) [key] = value; end |