Skip to content

Commit 7051f12

Browse files
committed
Tiny tweaks
1 parent 2515b67 commit 7051f12

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

posts/2025-10-30-the-joy-of-a-single-purpose-class-from-string-mutation-to-message-composition.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,9 @@ end
7979

8080
Respective messages produced would be:
8181

82-
`:postbox: | *Inovice sent to customer* | Jane Doh | [email protected] | <https://fancyurl.example.com|KAKADUDU123>`
82+
```
83+
:postbox: | *Inovice sent to customer* | Jane Doh | [email protected] | <https://fancyurl.example.com|KAKADUDU123>
84+
```
8385

8486
and
8587

@@ -207,7 +209,10 @@ Otherwise we would need to put a bit more effort into our class:
207209

208210
```ruby
209211
def to_s
210-
@message.compact.reject { |part| part.respond_to?(:empty?) && part.empty? }.join(@delimiter)
212+
@message
213+
.compact
214+
.reject { |part| part.respond_to?(:empty?) && part.empty? }
215+
.join(@delimiter)
211216
end
212217
```
213218

@@ -324,7 +329,8 @@ This recursive flattening happens transparently because `to_str` signals to Ruby
324329
end
325330

326331
def send_message(channel_name, message)
327-
Slack::Client.deliver_message(channel: channel_name, message: message.to_s)
332+
- Slack::Client.deliver_message(channel: channel_name, message: message)
333+
+ Slack::Client.deliver_message(channel: channel_name, message: message.to_s)
328334
end
329335
end
330336
end

0 commit comments

Comments
 (0)