Class: C2eCore::Drops::CompanyClientDrop

Inherits:
BaseDrop
  • Object
show all
Defined in:
/build/app/mailers/c2e_core/drops/company_client_drop.rb

Instance Method Summary collapse

Constructor Details

#initialize(company) ⇒ CompanyClientDrop

Returns a new instance of CompanyClientDrop.



7
8
9
10
# File '/build/app/mailers/c2e_core/drops/company_client_drop.rb', line 7

def initialize(company)
  super()
  @company = company
end

Instance Method Details

#addressAddressDrop

Returns - Address of company as drop object.

Returns:



18
19
20
21
22
# File '/build/app/mailers/c2e_core/drops/company_client_drop.rb', line 18

def address
  stored_value __method__ do
    AddressDrop.new(@company.default_address.location || {})
  end
end

#cinString

Returns - Corporate Identity Number of company. ICO in Czechia.

Returns:

  • (String)
    • Corporate Identity Number of company. ICO in Czechia



25
26
27
# File '/build/app/mailers/c2e_core/drops/company_client_drop.rb', line 25

def cin
  @company.number
end

#default_emailString

Returns - The company’s default email, e.g. "test@example.com".

Returns:

  • (String)
    • The company’s default email, e.g. "test@example.com".



43
44
45
46
47
# File '/build/app/mailers/c2e_core/drops/company_client_drop.rb', line 43

def default_email
  stored_value __method__ do
    @company.default_email.try(:[], "email")
  end
end

#default_phoneString

Returns - The company’s default phone, e.g. "+420123456789".

Returns:

  • (String)
    • The company’s default phone, e.g. "+420123456789".



50
51
52
53
54
# File '/build/app/mailers/c2e_core/drops/company_client_drop.rb', line 50

def default_phone
  stored_value __method__ do
    @company.default_phone.try(:[], "phone")
  end
end

#is_vat_payerBoolean

Returns - Return true when company is VAT payer.

Returns:

  • (Boolean)
    • Return true when company is VAT payer.



37
38
39
# File '/build/app/mailers/c2e_core/drops/company_client_drop.rb', line 37

def is_vat_payer
  @company.vat_payer?
end

#nameString

Returns - Name of company. E.g.: “Monkey’s bar s.r.o.”.

Returns:

  • (String)
    • Name of company. E.g.: “Monkey’s bar s.r.o.”



13
14
15
# File '/build/app/mailers/c2e_core/drops/company_client_drop.rb', line 13

def name
  @company.name
end

#tinString

Returns - Taxpayer Identification Number of company. DIC in Czechia.

Returns:

  • (String)
    • Taxpayer Identification Number of company. DIC in Czechia



30
31
32
# File '/build/app/mailers/c2e_core/drops/company_client_drop.rb', line 30

def tin
  @company.vat_ident
end