Class: MsTeamsHermes::Components::ActionSet

Inherits:
Base
  • Object
show all
Defined in:
lib/msteams_hermes/components/action_set.rb

Overview

A class representing Microsoft’s ActionSet object adaptivecards.io/explorer/ActionSet.html

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(actions:) ⇒ ActionSet

Returns a new instance of ActionSet.



18
19
20
21
# File 'lib/msteams_hermes/components/action_set.rb', line 18

def initialize(actions:)
  @actions = actions
  raise "ActionSet `actions` must be an Array" unless @actions.is_a? Array
end

Instance Attribute Details

#actionsObject (readonly)

Returns the value of attribute actions.



16
17
18
# File 'lib/msteams_hermes/components/action_set.rb', line 16

def actions
  @actions
end

Instance Method Details

#to_hashObject



23
24
25
26
27
28
# File 'lib/msteams_hermes/components/action_set.rb', line 23

def to_hash
  {
    type: "ActionSet",
    actions: actions.map(&:to_hash)
  }
end