Class: Blacksmith::Hammer
- Inherits:
-
Object
- Object
- Blacksmith::Hammer
- Defined in:
- lib/blacksmith/hammer.rb
Instance Method Summary collapse
- #connection ⇒ Object
-
#initialize(url: nil) ⇒ Hammer
constructor
A new instance of Hammer.
- #slam ⇒ Object
Constructor Details
#initialize(url: nil) ⇒ Hammer
Returns a new instance of Hammer.
5 6 7 8 |
# File 'lib/blacksmith/hammer.rb', line 5 def initialize(url: nil) @target_room = Blacksmith::Config.room @url = url end |
Instance Method Details
#connection ⇒ Object
10 11 12 |
# File 'lib/blacksmith/hammer.rb', line 10 def connection Blacksmith::Config.connection end |
#slam ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/blacksmith/hammer.rb', line 14 def slam = { message_format: "html", } connection[@target_room].send( Blacksmith::Config.title, "<img src=\"#{@url}\" />", ) end |