Class: Groupme::Cli::Message

Inherits:
Object
  • Object
show all
Defined in:
lib/groupme/cli/message.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#senderObject (readonly)

Returns the value of attribute sender.



6
7
8
# File 'lib/groupme/cli/message.rb', line 6

def sender
  @sender
end

#textObject (readonly)

Returns the value of attribute text.



6
7
8
# File 'lib/groupme/cli/message.rb', line 6

def text
  @text
end

#timeObject (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_sObject



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