Class: C2eCore::Drops::CompanyBranchDrop
- Defined in:
- /build/app/mailers/c2e_core/drops/company_branch_drop.rb
Instance Method Summary collapse
-
#address ⇒ C2eCore::Drops::AddressDrop
-
Default address of company branch as drop object.
-
-
#client ⇒ CompanyClientDrop
-
Company to which company branch belongs as drop object.
-
-
#currency ⇒ CurrencyDrop
-
Default currency of company branch.
-
-
#email ⇒ String
-
Default email of company branch.
-
-
#id ⇒ Integer
-
ID of company branch in database.
-
-
#initialize(company_branch) ⇒ CompanyBranchDrop
constructor
A new instance of CompanyBranchDrop.
-
#name ⇒ String
-
Name of company branch.
-
-
#phone ⇒ String
-
Default phone number of company branch.
-
Constructor Details
#initialize(company_branch) ⇒ CompanyBranchDrop
Returns a new instance of CompanyBranchDrop.
7 8 9 10 |
# File '/build/app/mailers/c2e_core/drops/company_branch_drop.rb', line 7 def initialize(company_branch) super() @company_branch = company_branch end |
Instance Method Details
#address ⇒ C2eCore::Drops::AddressDrop
Returns - Default address of company branch as drop object.
44 45 46 47 48 |
# File '/build/app/mailers/c2e_core/drops/company_branch_drop.rb', line 44 def address stored_value __method__ do AddressDrop.new(@company_branch.default_address.location || {}) end end |
#client ⇒ CompanyClientDrop
Returns - Company to which company branch belongs as drop object.
18 19 20 21 22 |
# File '/build/app/mailers/c2e_core/drops/company_branch_drop.rb', line 18 def client stored_value __method__ do CompanyClientDrop.new @company_branch.company end end |
#currency ⇒ CurrencyDrop
Returns - Default currency of company branch.
51 52 53 54 55 |
# File '/build/app/mailers/c2e_core/drops/company_branch_drop.rb', line 51 def currency stored_value __method__ do CurrencyDrop.new @company_branch.default_currency end end |
#email ⇒ String
Returns - Default email of company branch. E.g.: “objednavky@pizzacipola.cz”.
37 38 39 40 41 |
# File '/build/app/mailers/c2e_core/drops/company_branch_drop.rb', line 37 def email stored_value __method__ do @company_branch.default_email.try(:[], "email") end end |
#id ⇒ Integer
Returns - ID of company branch in database.
13 14 15 |
# File '/build/app/mailers/c2e_core/drops/company_branch_drop.rb', line 13 def id @company_branch.id end |
#name ⇒ String
Returns - Name of company branch. E.g.: “Pizza Cipola Háje”.
25 26 27 |
# File '/build/app/mailers/c2e_core/drops/company_branch_drop.rb', line 25 def name @company_branch.name end |
#phone ⇒ String
Returns - Default phone number of company branch. E.g.: “420987654321”.
30 31 32 33 34 |
# File '/build/app/mailers/c2e_core/drops/company_branch_drop.rb', line 30 def phone stored_value __method__ do @company_branch.default_phone.try(:[], "phone") end end |