Class: MsTeamsHermes::Components::TextBlock
- Defined in:
- lib/msteams_hermes/components/text_block.rb
Overview
A class representing Microsoft’s TextBlock object adaptivecards.io/explorer/TextBlock.html
Instance Attribute Summary collapse
-
#color ⇒ Object
readonly
Returns the value of attribute color.
-
#font_type ⇒ Object
readonly
Returns the value of attribute font_type.
-
#is_subtle ⇒ Object
readonly
Returns the value of attribute is_subtle.
-
#size ⇒ Object
readonly
Returns the value of attribute size.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
-
#weight ⇒ Object
readonly
Returns the value of attribute weight.
-
#wrap ⇒ Object
readonly
Returns the value of attribute wrap.
Instance Method Summary collapse
-
#initialize(text:, wrap: false, color: Style::Colors::DEFAULT, size: Style::FontSize::DEFAULT, font_type: Style::FontType::DEFAULT, weight: Style::FontWeight::DEFAULT, is_subtle: false) ⇒ TextBlock
constructor
A new instance of TextBlock.
- #to_hash ⇒ Object
Constructor Details
#initialize(text:, wrap: false, color: Style::Colors::DEFAULT, size: Style::FontSize::DEFAULT, font_type: Style::FontType::DEFAULT, weight: Style::FontWeight::DEFAULT, is_subtle: false) ⇒ TextBlock
Returns a new instance of TextBlock.
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/msteams_hermes/components/text_block.rb', line 19 def initialize(text:, wrap: false, color: Style::Colors::DEFAULT, size: Style::FontSize::DEFAULT, font_type: Style::FontType::DEFAULT, weight: Style::FontWeight::DEFAULT, is_subtle: false) @text = text raise "TextBlock `text` must be a String" unless @text.is_a? String @wrap = wrap @color = color @size = size @font_type = font_type @weight = weight @is_subtle = is_subtle end |
Instance Attribute Details
#color ⇒ Object (readonly)
Returns the value of attribute color.
17 18 19 |
# File 'lib/msteams_hermes/components/text_block.rb', line 17 def color @color end |
#font_type ⇒ Object (readonly)
Returns the value of attribute font_type.
17 18 19 |
# File 'lib/msteams_hermes/components/text_block.rb', line 17 def font_type @font_type end |
#is_subtle ⇒ Object (readonly)
Returns the value of attribute is_subtle.
17 18 19 |
# File 'lib/msteams_hermes/components/text_block.rb', line 17 def is_subtle @is_subtle end |
#size ⇒ Object (readonly)
Returns the value of attribute size.
17 18 19 |
# File 'lib/msteams_hermes/components/text_block.rb', line 17 def size @size end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
17 18 19 |
# File 'lib/msteams_hermes/components/text_block.rb', line 17 def text @text end |
#weight ⇒ Object (readonly)
Returns the value of attribute weight.
17 18 19 |
# File 'lib/msteams_hermes/components/text_block.rb', line 17 def weight @weight end |
#wrap ⇒ Object (readonly)
Returns the value of attribute wrap.
17 18 19 |
# File 'lib/msteams_hermes/components/text_block.rb', line 17 def wrap @wrap end |
Instance Method Details
#to_hash ⇒ Object
37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/msteams_hermes/components/text_block.rb', line 37 def to_hash { type: "TextBlock", text:, color:, size:, font_type:, weight:, wrap:, is_subtle: } end |