Class: Ask::Actions::Context

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

Overview

A per-request bag of context. Channel adapters construct it with whatever the app needs — user, session, workspace, channel, voice call — and actions read from it. Attributes become accessors on the instance.

Examples:

context = Ask::Actions::Context.new(user: user, session: session, workspace: workspace)
context.user      # => user
context.workspace # => workspace

Instance Method Summary collapse

Constructor Details

#initialize(**attributes) ⇒ Context

Returns a new instance of Context.



14
15
16
# File 'lib/ask/actions/context.rb', line 14

def initialize(**attributes)
  attributes.each { |name, value| define_attribute(name, value) }
end