Class: Appydave::Tools::Configuration::Models::ChannelsConfig::ChannelInfo

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

Overview

Type-safe class to access channel properties

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key, data) ⇒ ChannelInfo

Returns a new instance of ChannelInfo.



88
89
90
91
92
93
94
# File 'lib/appydave/tools/configuration/models/channels_config.rb', line 88

def initialize(key, data)
  @key = key
  @code = data['code']
  @name = data['name']
  @youtube_handle = data['youtube_handle']
  @locations = ChannelLocation.new(data['locations'] || {})
end

Instance Attribute Details

#codeObject

Returns the value of attribute code.



86
87
88
# File 'lib/appydave/tools/configuration/models/channels_config.rb', line 86

def code
  @code
end

#keyObject

Returns the value of attribute key.



86
87
88
# File 'lib/appydave/tools/configuration/models/channels_config.rb', line 86

def key
  @key
end

#locationsObject

Returns the value of attribute locations.



86
87
88
# File 'lib/appydave/tools/configuration/models/channels_config.rb', line 86

def locations
  @locations
end

#nameObject

Returns the value of attribute name.



86
87
88
# File 'lib/appydave/tools/configuration/models/channels_config.rb', line 86

def name
  @name
end

#youtube_handleObject

Returns the value of attribute youtube_handle.



86
87
88
# File 'lib/appydave/tools/configuration/models/channels_config.rb', line 86

def youtube_handle
  @youtube_handle
end

Instance Method Details

#to_hObject



96
97
98
99
100
101
102
103
# File 'lib/appydave/tools/configuration/models/channels_config.rb', line 96

def to_h
  {
    'code' => @code,
    'name' => @name,
    'youtube_handle' => @youtube_handle,
    'locations' => locations.to_h
  }
end