Class: Intelligence::MessageContent::Text
- Defined in:
- lib/intelligence/message_content/text.rb
Instance Attribute Summary collapse
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Instance Method Summary collapse
Methods inherited from Base
Constructor Details
This class inherits a constructor from Intelligence::MessageContent::Base
Instance Attribute Details
#text ⇒ Object (readonly)
Returns the value of attribute text.
10 11 12 |
# File 'lib/intelligence/message_content/text.rb', line 10 def text @text end |
Instance Method Details
#to_h ⇒ Object
16 17 18 |
# File 'lib/intelligence/message_content/text.rb', line 16 def to_h { type: :text, text: text } end |
#valid? ⇒ Boolean
12 13 14 |
# File 'lib/intelligence/message_content/text.rb', line 12 def valid? ( text || false ) && text.respond_to?( :empty? ) && !text.empty? end |