Class: Appydave::Tools::Configuration::Models::BrandsConfig::BrandInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/appydave/tools/configuration/models/brands_config.rb

Overview

Type-safe class to access brand properties

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key, data) ⇒ BrandInfo

Returns a new instance of BrandInfo.



169
170
171
172
173
174
175
176
177
178
179
180
# File 'lib/appydave/tools/configuration/models/brands_config.rb', line 169

def initialize(key, data)
  @key = key
  @name = data['name']
  @shortcut = data['shortcut']
  @type = data['type'] || 'owned'
  @youtube_channels = data['youtube_channels'] || []
  @team = data['team'] || []
  @git_remote = data['git_remote']
  @locations = BrandLocation.new(data['locations'] || {})
  @aws = BrandAws.new(data['aws'] || {})
  @settings = BrandSettings.new(data['settings'] || {})
end

Instance Attribute Details

#awsObject

Returns the value of attribute aws.



167
168
169
# File 'lib/appydave/tools/configuration/models/brands_config.rb', line 167

def aws
  @aws
end

#git_remoteObject

Returns the value of attribute git_remote.



167
168
169
# File 'lib/appydave/tools/configuration/models/brands_config.rb', line 167

def git_remote
  @git_remote
end

#keyObject

Returns the value of attribute key.



167
168
169
# File 'lib/appydave/tools/configuration/models/brands_config.rb', line 167

def key
  @key
end

#locationsObject

Returns the value of attribute locations.



167
168
169
# File 'lib/appydave/tools/configuration/models/brands_config.rb', line 167

def locations
  @locations
end

#nameObject

Returns the value of attribute name.



167
168
169
# File 'lib/appydave/tools/configuration/models/brands_config.rb', line 167

def name
  @name
end

#settingsObject

Returns the value of attribute settings.



167
168
169
# File 'lib/appydave/tools/configuration/models/brands_config.rb', line 167

def settings
  @settings
end

#shortcutObject

Returns the value of attribute shortcut.



167
168
169
# File 'lib/appydave/tools/configuration/models/brands_config.rb', line 167

def shortcut
  @shortcut
end

#teamObject

Returns the value of attribute team.



167
168
169
# File 'lib/appydave/tools/configuration/models/brands_config.rb', line 167

def team
  @team
end

#typeObject

Returns the value of attribute type.



167
168
169
# File 'lib/appydave/tools/configuration/models/brands_config.rb', line 167

def type
  @type
end

#youtube_channelsObject

Returns the value of attribute youtube_channels.



167
168
169
# File 'lib/appydave/tools/configuration/models/brands_config.rb', line 167

def youtube_channels
  @youtube_channels
end

Instance Method Details

#to_hObject



182
183
184
185
186
187
188
189
190
191
192
193
194
# File 'lib/appydave/tools/configuration/models/brands_config.rb', line 182

def to_h
  {
    'name' => @name,
    'shortcut' => @shortcut,
    'type' => @type,
    'youtube_channels' => @youtube_channels,
    'team' => @team,
    'git_remote' => @git_remote,
    'locations' => @locations.to_h,
    'aws' => @aws.to_h,
    'settings' => @settings.to_h
  }
end