Class: DanceTime::Channel

Inherits:
Object
  • Object
show all
Defined in:
lib/dance_time/channel.rb

Constant Summary collapse

@@all =
[]

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name = nil, about = nil, youtube_link = nil, frequency = nil) ⇒ Channel

Returns a new instance of Channel.



6
7
8
9
10
11
12
# File 'lib/dance_time/channel.rb', line 6

def initialize(name=nil, about=nil, youtube_link=nil, frequency=nil)
  @name = name
  @about = about
  @youtube_link = youtube_link
  @frequency = frequency
  @@all << self
end

Instance Attribute Details

#aboutObject

Returns the value of attribute about.



2
3
4
# File 'lib/dance_time/channel.rb', line 2

def about
  @about
end

#frequencyObject

Returns the value of attribute frequency.



2
3
4
# File 'lib/dance_time/channel.rb', line 2

def frequency
  @frequency
end

#nameObject

Returns the value of attribute name.



2
3
4
# File 'lib/dance_time/channel.rb', line 2

def name
  @name
end

Returns the value of attribute youtube_link.



2
3
4
# File 'lib/dance_time/channel.rb', line 2

def youtube_link
  @youtube_link
end

Class Method Details

.allObject



14
15
16
# File 'lib/dance_time/channel.rb', line 14

def self.all
  @@all
end

.find(number) ⇒ Object



19
20
21
22
# File 'lib/dance_time/channel.rb', line 19

def self.find(number)
  number -= 1
  self.all[number]
end