lib/slack/block_kit/composition/option.rb in slack-ruby-block-kit-0.6.1 vs lib/slack/block_kit/composition/option.rb in slack-ruby-block-kit-0.7.0
- old
+ new
@@ -9,10 +9,10 @@
# https://api.slack.com/reference/messaging/block-elements#select
class Option
def initialize(value:, text:, emoji: nil, description: nil, url: nil)
@text = PlainText.new(text: text, emoji: emoji)
@value = value
- @description = PlainText.new(text: description, emoji: emoji) if description
+ @description = description && PlainText.new(text: description, emoji: emoji)
@url = url
end
def as_json(*)
{