Class: Woody::Decorators::Brand
- Inherits:
-
Base
- Object
- Base
- Woody::Decorators::Brand
show all
- Defined in:
- lib/woody/decorators/brand.rb
Instance Method Summary
collapse
Methods inherited from Base
#method_missing
Constructor Details
#initialize(model, config) ⇒ Brand
Returns a new instance of Brand.
7
8
9
10
|
# File 'lib/woody/decorators/brand.rb', line 7
def initialize(model, config)
@config = config
super(model)
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
in the class Woody::Decorators::Base
Instance Method Details
#briefs ⇒ Object
12
13
14
15
16
|
# File 'lib/woody/decorators/brand.rb', line 12
def briefs
@model.briefs.map do |c|
Brief.new(c, @config)
end
end
|
#facebook_account ⇒ Object
18
19
20
|
# File 'lib/woody/decorators/brand.rb', line 18
def facebook_account
find_partner_account('facebook')
end
|
#facebook_account_connected? ⇒ Boolean
22
23
24
|
# File 'lib/woody/decorators/brand.rb', line 22
def facebook_account_connected?
!facebook_account.nil?
end
|
#logo_url ⇒ Object
26
27
28
29
30
31
32
33
34
|
# File 'lib/woody/decorators/brand.rb', line 26
def logo_url
base_path = format(
'%s/%s/brands/logos/%s_%s',
@config.app["s3_domain"],
@config.app["public_s3_bucket"],
id,
@model.avatar_guid,
)
end
|
#partner_accounts ⇒ Object
36
37
38
|
# File 'lib/woody/decorators/brand.rb', line 36
def partner_accounts
@partner_accounts = @model.partner_accounts
end
|
#snapchat_account ⇒ Object
40
41
42
|
# File 'lib/woody/decorators/brand.rb', line 40
def snapchat_account
find_partner_account('snapchat')
end
|
#snapchat_account_connected? ⇒ Boolean
44
45
46
|
# File 'lib/woody/decorators/brand.rb', line 44
def snapchat_account_connected?
!snapchat_account.nil?
end
|