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.
-
#option_set ⇒ Hash
Returns the hash 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.
22 23 24 |
# File 'lib/riot/context_options.rb', line 22 def option(key) option_set[key] end |
#option_set ⇒ Hash
Returns the hash of defined options.
29 30 31 |
# File 'lib/riot/context_options.rb', line 29 def option_set @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
13 14 15 |
# File 'lib/riot/context_options.rb', line 13 def set(key, value) option_set[key] = value end |