Class: MsTeamsHermes::Components::Column
- Defined in:
- lib/msteams_hermes/components/column.rb
Overview
A class representing Microsoft’s Column object adaptivecards.io/explorer/Column.html
Instance Attribute Summary collapse
-
#items ⇒ Object
readonly
Returns the value of attribute items.
-
#width ⇒ Object
readonly
Returns the value of attribute width.
Instance Method Summary collapse
-
#initialize(items:, width: "auto") ⇒ Column
constructor
A new instance of Column.
- #to_hash ⇒ Object
Constructor Details
#initialize(items:, width: "auto") ⇒ Column
Returns a new instance of Column.
18 19 20 21 22 23 |
# File 'lib/msteams_hermes/components/column.rb', line 18 def initialize(items:, width: "auto") @items = items raise "Column `items` must be an Array" unless @items.is_a? Array @width = width end |
Instance Attribute Details
#items ⇒ Object (readonly)
Returns the value of attribute items.
16 17 18 |
# File 'lib/msteams_hermes/components/column.rb', line 16 def items @items end |
#width ⇒ Object (readonly)
Returns the value of attribute width.
16 17 18 |
# File 'lib/msteams_hermes/components/column.rb', line 16 def width @width end |
Instance Method Details
#to_hash ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/msteams_hermes/components/column.rb', line 25 def to_hash { type: "Column", width:, items: items.map(&:to_hash) } end |