Class: MsTeamsHermes::Components::FactSet

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

Overview

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(facts:) ⇒ FactSet

Returns a new instance of FactSet.



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

def initialize(facts:)
  @facts = facts
  raise "FactSet `facts` must be an Array of hashes containing title and value keys" unless valid_facts?
end

Instance Attribute Details

#factsObject (readonly)

Returns the value of attribute facts.



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

def facts
  @facts
end

Instance Method Details

#to_hashObject



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

def to_hash
  {
    type: "FactSet",
    facts:
  }
end