Class: FlowChat::Context
- Inherits:
-
Object
- Object
- FlowChat::Context
- Defined in:
- lib/flow_chat/context.rb
Instance Method Summary collapse
- #[](key) ⇒ Object
- #[]=(key, value) ⇒ Object
- #controller ⇒ Object
-
#flow ⇒ Object
def request = controller.request.
-
#initialize ⇒ Context
constructor
A new instance of Context.
- #input ⇒ Object
- #session ⇒ Object
Constructor Details
#initialize ⇒ Context
Returns a new instance of Context.
3 4 5 |
# File 'lib/flow_chat/context.rb', line 3 def initialize @data = {}.with_indifferent_access end |
Instance Method Details
#[](key) ⇒ Object
7 8 9 |
# File 'lib/flow_chat/context.rb', line 7 def [](key) @data[key] end |
#[]=(key, value) ⇒ Object
11 12 13 |
# File 'lib/flow_chat/context.rb', line 11 def []=(key, value) @data[key] = value end |
#controller ⇒ Object
19 |
# File 'lib/flow_chat/context.rb', line 19 def controller = @data["controller"] |
#flow ⇒ Object
def request = controller.request
23 |
# File 'lib/flow_chat/context.rb', line 23 def flow = @data["flow.class"] |
#input ⇒ Object
15 |
# File 'lib/flow_chat/context.rb', line 15 def input = @data["request.input"] |
#session ⇒ Object
17 |
# File 'lib/flow_chat/context.rb', line 17 def session = @data["session"] |