Class: MsTeamsHermes::Components::ActionSet
- 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
-
#actions ⇒ Object
readonly
Returns the value of attribute actions.
Instance Method Summary collapse
-
#initialize(actions:) ⇒ ActionSet
constructor
A new instance of ActionSet.
- #to_hash ⇒ Object
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
#actions ⇒ Object (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_hash ⇒ Object
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 |