Class: Groupme::Cli::Message
- Inherits:
-
Object
- Object
- Groupme::Cli::Message
- Defined in:
- lib/groupme/cli/message.rb
Instance Attribute Summary collapse
-
#sender ⇒ Object
readonly
Returns the value of attribute sender.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
-
#time ⇒ Object
readonly
Returns the value of attribute time.
Instance Method Summary collapse
-
#initialize(sender:, time:, text:) ⇒ Message
constructor
A new instance of Message.
- #to_s ⇒ Object
Constructor Details
#initialize(sender:, time:, text:) ⇒ Message
Returns a new instance of Message.
8 9 10 |
# File 'lib/groupme/cli/message.rb', line 8 def initialize(sender:, time:, text:) @sender, @time, @text = sender, time, text end |
Instance Attribute Details
#sender ⇒ Object (readonly)
Returns the value of attribute sender.
6 7 8 |
# File 'lib/groupme/cli/message.rb', line 6 def sender @sender end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
6 7 8 |
# File 'lib/groupme/cli/message.rb', line 6 def text @text end |
#time ⇒ Object (readonly)
Returns the value of attribute time.
6 7 8 |
# File 'lib/groupme/cli/message.rb', line 6 def time @time end |
Instance Method Details
#to_s ⇒ Object
12 13 14 |
# File 'lib/groupme/cli/message.rb', line 12 def to_s "<#{@sender.colorize :blue}[#{fmt_time.colorize :red}]>:\n\t#{fmt_text}" end |