Class: Cb::CbJobBranding

Inherits:
Object
  • Object
show all
Defined in:
lib/cb/models/cb_job_branding.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args = {}) ⇒ CbJobBranding

Returns a new instance of CbJobBranding.



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/cb/models/cb_job_branding.rb', line 6

def initialize args = {}
  @name = args['Name'] || ''
  @id = args['Id'] || ''
  @account_id = args['AccountId'] || ''
  @type = args['Type'] || ''
  @media = Cb::Branding::Media.new args['Media']
  @styles = Cb::Branding::Style.new args['Styles']
  @errors = args['Errors'] || ''

  @sections, @widgets = [], []

  args['Sections'].each do |type, sections|
    @sections << Cb::Branding::Section.new(type, sections) unless sections.nil?
  end

  args['Widgets'].each do |type, url|
    if type == 'ShowWidgets'
      @show_widgets = url == 'true'
    else
      @widgets << Cb::Branding::Widget.new(type, url) unless url.nil?
    end
  end
end

Instance Attribute Details

#account_idObject

Returns the value of attribute account_id.



4
5
6
# File 'lib/cb/models/cb_job_branding.rb', line 4

def 
  @account_id
end

#errorsObject

Returns the value of attribute errors.



4
5
6
# File 'lib/cb/models/cb_job_branding.rb', line 4

def errors
  @errors
end

#idObject

Returns the value of attribute id.



4
5
6
# File 'lib/cb/models/cb_job_branding.rb', line 4

def id
  @id
end

#mediaObject

Returns the value of attribute media.



4
5
6
# File 'lib/cb/models/cb_job_branding.rb', line 4

def media
  @media
end

#nameObject

Returns the value of attribute name.



4
5
6
# File 'lib/cb/models/cb_job_branding.rb', line 4

def name
  @name
end

#sectionsObject

Returns the value of attribute sections.



4
5
6
# File 'lib/cb/models/cb_job_branding.rb', line 4

def sections
  @sections
end

#show_widgetsObject

Returns the value of attribute show_widgets.



4
5
6
# File 'lib/cb/models/cb_job_branding.rb', line 4

def show_widgets
  @show_widgets
end

#stylesObject

Returns the value of attribute styles.



4
5
6
# File 'lib/cb/models/cb_job_branding.rb', line 4

def styles
  @styles
end

#typeObject

Returns the value of attribute type.



4
5
6
# File 'lib/cb/models/cb_job_branding.rb', line 4

def type
  @type
end

#widgetsObject

Returns the value of attribute widgets.



4
5
6
# File 'lib/cb/models/cb_job_branding.rb', line 4

def widgets
  @widgets
end