Class: BotPlatform::Activity

Inherits:
Object
  • Object
show all
Defined in:
lib/bot_platform/activity.rb

Constant Summary collapse

TYPES =
{
  typing: 1, 
  message: 2,
  image: 3,
  confirm: 4,
  options: 5,
  carousel: 6,
  command: 7,
  card: 9 
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type, opts = {}) ⇒ Activity

Returns a new instance of Activity.



18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/bot_platform/activity.rb', line 18

def initialize(type, opts={})
  @type = type
  @resource_id = opts[:resource_id]
  @content = opts[:content]
  @options = opts[:options]
  @prefix = opts[:prefix]
  @text = opts[:text]
  @preview_url = opts[:preview_url]
  @resource_url = opts[:resource_url]
  @from = opts[:from]
  @to = opts[:to]
  @channel_id = opts[:channel_id]
end

Instance Attribute Details

#channel_idObject (readonly)

Returns the value of attribute channel_id.



5
6
7
# File 'lib/bot_platform/activity.rb', line 5

def channel_id
  @channel_id
end

#contentObject (readonly)

Returns the value of attribute content.



5
6
7
# File 'lib/bot_platform/activity.rb', line 5

def content
  @content
end

#fromObject (readonly)

Returns the value of attribute from.



5
6
7
# File 'lib/bot_platform/activity.rb', line 5

def from
  @from
end

#optionsObject (readonly)

Returns the value of attribute options.



5
6
7
# File 'lib/bot_platform/activity.rb', line 5

def options
  @options
end

#prefixObject (readonly)

Returns the value of attribute prefix.



5
6
7
# File 'lib/bot_platform/activity.rb', line 5

def prefix
  @prefix
end

#preview_urlObject (readonly)

Returns the value of attribute preview_url.



5
6
7
# File 'lib/bot_platform/activity.rb', line 5

def preview_url
  @preview_url
end

#resource_idObject (readonly)

Returns the value of attribute resource_id.



5
6
7
# File 'lib/bot_platform/activity.rb', line 5

def resource_id
  @resource_id
end

#resource_urlObject (readonly)

Returns the value of attribute resource_url.



5
6
7
# File 'lib/bot_platform/activity.rb', line 5

def resource_url
  @resource_url
end

#textObject (readonly)

Returns the value of attribute text.



5
6
7
# File 'lib/bot_platform/activity.rb', line 5

def text
  @text
end

#toObject

Returns the value of attribute to.



6
7
8
# File 'lib/bot_platform/activity.rb', line 6

def to
  @to
end

#typeObject (readonly)

Returns the value of attribute type.



5
6
7
# File 'lib/bot_platform/activity.rb', line 5

def type
  @type
end