Class: FlowChat::Context

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_chat/context.rb

Instance Method Summary collapse

Constructor Details

#initializeContext

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

#controllerObject



19
# File 'lib/flow_chat/context.rb', line 19

def controller = @data["controller"]

#flowObject

def request = controller.request



23
# File 'lib/flow_chat/context.rb', line 23

def flow = @data["flow.class"]

#inputObject



15
# File 'lib/flow_chat/context.rb', line 15

def input = @data["request.input"]

#sessionObject



17
# File 'lib/flow_chat/context.rb', line 17

def session = @data["session"]