Class: Appydave::Tools::Configuration::Models::ChannelsConfig::ChannelInfo
- Inherits:
-
Object
- Object
- Appydave::Tools::Configuration::Models::ChannelsConfig::ChannelInfo
- Defined in:
- lib/appydave/tools/configuration/models/channels_config.rb
Overview
Type-safe class to access channel properties
Instance Attribute Summary collapse
-
#code ⇒ Object
Returns the value of attribute code.
-
#key ⇒ Object
Returns the value of attribute key.
-
#locations ⇒ Object
Returns the value of attribute locations.
-
#name ⇒ Object
Returns the value of attribute name.
-
#youtube_handle ⇒ Object
Returns the value of attribute youtube_handle.
Instance Method Summary collapse
-
#initialize(key, data) ⇒ ChannelInfo
constructor
A new instance of ChannelInfo.
- #to_h ⇒ Object
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
#code ⇒ Object
Returns the value of attribute code.
86 87 88 |
# File 'lib/appydave/tools/configuration/models/channels_config.rb', line 86 def code @code end |
#key ⇒ Object
Returns the value of attribute key.
86 87 88 |
# File 'lib/appydave/tools/configuration/models/channels_config.rb', line 86 def key @key end |
#locations ⇒ Object
Returns the value of attribute locations.
86 87 88 |
# File 'lib/appydave/tools/configuration/models/channels_config.rb', line 86 def locations @locations end |
#name ⇒ Object
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_handle ⇒ Object
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_h ⇒ Object
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 |