Class: Cb::Models::JobBranding

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args = {}) ⇒ JobBranding

Returns a new instance of JobBranding.



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/cb/models/implementations/job_branding.rb', line 16

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

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

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

Instance Attribute Details

#account_idObject

Returns the value of attribute account_id.



14
15
16
# File 'lib/cb/models/implementations/job_branding.rb', line 14

def 
  @account_id
end

#company_descriptionObject

Returns the value of attribute company_description.



14
15
16
# File 'lib/cb/models/implementations/job_branding.rb', line 14

def company_description
  @company_description
end

#errorsObject

Returns the value of attribute errors.



14
15
16
# File 'lib/cb/models/implementations/job_branding.rb', line 14

def errors
  @errors
end

#idObject

Returns the value of attribute id.



14
15
16
# File 'lib/cb/models/implementations/job_branding.rb', line 14

def id
  @id
end

#mediaObject

Returns the value of attribute media.



14
15
16
# File 'lib/cb/models/implementations/job_branding.rb', line 14

def media
  @media
end

#nameObject

Returns the value of attribute name.



14
15
16
# File 'lib/cb/models/implementations/job_branding.rb', line 14

def name
  @name
end

#sectionsObject

Returns the value of attribute sections.



14
15
16
# File 'lib/cb/models/implementations/job_branding.rb', line 14

def sections
  @sections
end

#show_widgetsObject

Returns the value of attribute show_widgets.



14
15
16
# File 'lib/cb/models/implementations/job_branding.rb', line 14

def show_widgets
  @show_widgets
end

#stylesObject

Returns the value of attribute styles.



14
15
16
# File 'lib/cb/models/implementations/job_branding.rb', line 14

def styles
  @styles
end

#typeObject

Returns the value of attribute type.



14
15
16
# File 'lib/cb/models/implementations/job_branding.rb', line 14

def type
  @type
end

#widgetsObject

Returns the value of attribute widgets.



14
15
16
# File 'lib/cb/models/implementations/job_branding.rb', line 14

def widgets
  @widgets
end