Class: FuncBot::Bots::Message
- Inherits:
-
Object
- Object
- FuncBot::Bots::Message
- Defined in:
- lib/func_bot/bots/message.rb
Instance Attribute Summary collapse
-
#content ⇒ Object
Returns the value of attribute content.
-
#name ⇒ Object
Returns the value of attribute name.
-
#role ⇒ Object
Returns the value of attribute role.
Instance Method Summary collapse
- #data ⇒ Object
-
#initialize(role, content, name = nil) ⇒ Message
constructor
A new instance of Message.
Constructor Details
#initialize(role, content, name = nil) ⇒ Message
Returns a new instance of Message.
6 7 8 9 10 |
# File 'lib/func_bot/bots/message.rb', line 6 def initialize(role, content, name = nil) @role = role @content = content @name = name end |
Instance Attribute Details
#content ⇒ Object
Returns the value of attribute content.
4 5 6 |
# File 'lib/func_bot/bots/message.rb', line 4 def content @content end |
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/func_bot/bots/message.rb', line 4 def name @name end |
#role ⇒ Object
Returns the value of attribute role.
4 5 6 |
# File 'lib/func_bot/bots/message.rb', line 4 def role @role end |
Instance Method Details
#data ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/func_bot/bots/message.rb', line 12 def data if name.nil? {role: role, content: content} else {role: role, content: content, name: name} end end |