Class: SpreeCmCommissioner::EventTelegramMessageFactory
- Inherits:
-
TelegramMessageFactory
- Object
- TelegramMessageFactory
- SpreeCmCommissioner::EventTelegramMessageFactory
- Defined in:
- app/factory/spree_cm_commissioner/event_telegram_message_factory.rb
Instance Attribute Summary collapse
-
#event ⇒ Object
readonly
Returns the value of attribute event.
Attributes inherited from TelegramMessageFactory
Instance Method Summary collapse
- #body ⇒ Object
-
#initialize(event:) ⇒ EventTelegramMessageFactory
constructor
A new instance of EventTelegramMessageFactory.
Methods inherited from TelegramMessageFactory
#bold, #footer, #header, #inline_code, #italic, #message, #parse_mode, #pretty_date
Constructor Details
#initialize(event:) ⇒ EventTelegramMessageFactory
Returns a new instance of EventTelegramMessageFactory.
15 16 17 18 19 20 21 |
# File 'app/factory/spree_cm_commissioner/event_telegram_message_factory.rb', line 15 def initialize(event:) @event = event title = "✨ #{event.name} ✨" super(title: title) end |
Instance Attribute Details
#event ⇒ Object (readonly)
Returns the value of attribute event.
13 14 15 |
# File 'app/factory/spree_cm_commissioner/event_telegram_message_factory.rb', line 13 def event @event end |
Instance Method Details
#body ⇒ Object
23 24 25 26 27 28 29 30 |
# File 'app/factory/spree_cm_commissioner/event_telegram_message_factory.rb', line 23 def body [ event_name_line, organizer_line, [start_date_line, end_date_line].compact.join("\n"), event_url_line ].compact_blank.join("\n\n") end |