Class: ChatSDK::Cards::Node
- Inherits:
-
Object
- Object
- ChatSDK::Cards::Node
- Defined in:
- lib/chat_sdk/cards/node.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#children ⇒ Object
readonly
Returns the value of attribute children.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #fallback_text ⇒ Object
-
#initialize(type, attributes: {}, children: []) ⇒ Node
constructor
A new instance of Node.
Constructor Details
#initialize(type, attributes: {}, children: []) ⇒ Node
Returns a new instance of Node.
8 9 10 11 12 |
# File 'lib/chat_sdk/cards/node.rb', line 8 def initialize(type, attributes: {}, children: []) @type = type @attributes = attributes @children = children.freeze end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
6 7 8 |
# File 'lib/chat_sdk/cards/node.rb', line 6 def attributes @attributes end |
#children ⇒ Object (readonly)
Returns the value of attribute children.
6 7 8 |
# File 'lib/chat_sdk/cards/node.rb', line 6 def children @children end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
6 7 8 |
# File 'lib/chat_sdk/cards/node.rb', line 6 def type @type end |
Instance Method Details
#==(other) ⇒ Object
18 19 20 21 |
# File 'lib/chat_sdk/cards/node.rb', line 18 def ==(other) other.is_a?(Node) && type == other.type && attributes == other.attributes && children == other.children end |
#fallback_text ⇒ Object
14 15 16 |
# File 'lib/chat_sdk/cards/node.rb', line 14 def fallback_text collect_text.join("\n").strip end |