Class: SpreeCmCommissioner::VendorTelegramMessageFactory

Inherits:
TelegramMessageFactory show all
Defined in:
app/factory/spree_cm_commissioner/vendor_telegram_message_factory.rb

Instance Attribute Summary collapse

Attributes inherited from TelegramMessageFactory

#subtitle, #title

Instance Method Summary collapse

Methods inherited from TelegramMessageFactory

#bold, #footer, #header, #inline_code, #italic, #message, #parse_mode, #pretty_date

Constructor Details

#initialize(vendor:) ⇒ VendorTelegramMessageFactory

Returns a new instance of VendorTelegramMessageFactory.



16
17
18
19
20
21
22
# File 'app/factory/spree_cm_commissioner/vendor_telegram_message_factory.rb', line 16

def initialize(vendor:)
  @vendor = vendor

  title = '✨ New Vendor ✨'

  super(title: title)
end

Instance Attribute Details

#vendorObject (readonly)

Returns the value of attribute vendor.



14
15
16
# File 'app/factory/spree_cm_commissioner/vendor_telegram_message_factory.rb', line 14

def vendor
  @vendor
end

Instance Method Details

#bodyObject



24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'app/factory/spree_cm_commissioner/vendor_telegram_message_factory.rb', line 24

def body
  [
    "📝 Name: #{vendor.name}",
    '',
    email_line,
    phone_line,
    '',
    creator_line,
    created_at_line,
    '',
    url_line
  ].compact.join("\n")
end