Class: Chat::DotCommand::Shrug

Inherits:
Object
  • Object
show all
Defined in:
app/models/chat/dot_command/shrug.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, text) ⇒ Shrug

Returns a new instance of Shrug.



8
9
10
11
# File 'app/models/chat/dot_command/shrug.rb', line 8

def initialize(message, text)
  @message = message
  @text = text
end

Instance Attribute Details

#messageObject (readonly)

Returns the value of attribute message.



6
7
8
# File 'app/models/chat/dot_command/shrug.rb', line 6

def message
  @message
end

#textObject (readonly)

Returns the value of attribute text.



6
7
8
# File 'app/models/chat/dot_command/shrug.rb', line 6

def text
  @text
end

Instance Method Details

#performObject



13
14
15
16
17
18
19
20
# File 'app/models/chat/dot_command/shrug.rb', line 13

def perform
  message.text =
    if text.blank?
      shruggie
    else
      "#{text} #{shruggie}"
    end
end