Class: Chat::DotCommand::Gif
- Inherits:
-
Object
- Object
- Chat::DotCommand::Gif
- Defined in:
- app/models/chat/dot_command/gif.rb
Instance Attribute Summary collapse
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Instance Method Summary collapse
-
#initialize(message, text) ⇒ Gif
constructor
A new instance of Gif.
- #perform ⇒ Object
Constructor Details
#initialize(message, text) ⇒ Gif
Returns a new instance of Gif.
8 9 10 11 |
# File 'app/models/chat/dot_command/gif.rb', line 8 def initialize(, text) @message = @text = text end |
Instance Attribute Details
#message ⇒ Object (readonly)
Returns the value of attribute message.
6 7 8 |
# File 'app/models/chat/dot_command/gif.rb', line 6 def @message end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
6 7 8 |
# File 'app/models/chat/dot_command/gif.rb', line 6 def text @text end |
Instance Method Details
#perform ⇒ Object
13 14 15 16 |
# File 'app/models/chat/dot_command/gif.rb', line 13 def perform .image = open(::Giphy.random(text).image_url) .text = nil end |