Class: MsTeamsHermes::Components::ColumnSet

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

Overview

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(columns:) ⇒ ColumnSet

Returns a new instance of ColumnSet.



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

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

Instance Attribute Details

#columnsObject (readonly)

Returns the value of attribute columns.



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

def columns
  @columns
end

Instance Method Details

#to_hashObject



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

def to_hash
  {
    type: "ColumnSet",
    columns: columns.map(&:to_hash)
  }
end