Class: Context

Inherits:
Object
  • Object
show all
Defined in:
src/models/context.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#channelChannel?

Returns the current channel replies are sent to

Returns:

  • (Channel, nil)

    the current channel replies are sent to



3
4
5
# File 'src/models/context.rb', line 3

def channel
  @channel
end

#initial_messageMessage?

Returns the message that started the interaction

Returns:

  • (Message, nil)

    the message that started the interaction



12
13
14
# File 'src/models/context.rb', line 12

def initial_message
  @initial_message
end

#last_messageMessage?

Returns the latest user message in the interaction

Returns:

  • (Message, nil)

    the latest user message in the interaction



15
16
17
# File 'src/models/context.rb', line 15

def last_message
  @last_message
end

#threadMessageThread?

Returns the current thread replies are sent to

Returns:

  • (MessageThread, nil)

    the current thread replies are sent to



9
10
11
# File 'src/models/context.rb', line 9

def thread
  @thread
end

#userUser?

Returns the user initiating the interaction

Returns:

  • (User, nil)

    the user initiating the interaction



6
7
8
# File 'src/models/context.rb', line 6

def user
  @user
end

Instance Method Details

#system?Boolean

Check if this is a system event (triggered by SkillActions.on_start or SkillActions.on_stop)

Returns:

  • (Boolean)


58
59
60
# File 'src/models/context.rb', line 58

def system?
  !@user
end