Class: WhatToWatch::Show

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

Constant Summary collapse

@@all =

WhatToWatch::BestMovies.add_shows WhatToWatch::BestMovies.list() “y”, amazon_prime: “y”, hbo_now: “y”, hulu: “y”, showtime: “y”

[]
@@filtered =
[]

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(title = "", streaming_service = "", category = "") ⇒ Show

Returns a new instance of Show.



12
13
14
15
16
17
# File 'lib/what_to_watch/show.rb', line 12

def initialize(title="", streaming_service="", category= "")
  @title = title 
  @streaming_service = streaming_service
  @category = category
  @@all << self
end

Instance Attribute Details

#castObject

Returns the value of attribute cast.



2
3
4
# File 'lib/what_to_watch/show.rb', line 2

def cast
  @cast
end

#categoryObject

Returns the value of attribute category.



2
3
4
# File 'lib/what_to_watch/show.rb', line 2

def category
  @category
end

#descriptionObject

Returns the value of attribute description.



2
3
4
# File 'lib/what_to_watch/show.rb', line 2

def description
  @description
end

#genre_yearObject

Returns the value of attribute genre_year.



2
3
4
# File 'lib/what_to_watch/show.rb', line 2

def genre_year
  @genre_year
end

#streaming_serviceObject

Returns the value of attribute streaming_service.



2
3
4
# File 'lib/what_to_watch/show.rb', line 2

def streaming_service
  @streaming_service
end

#titleObject

Returns the value of attribute title.



2
3
4
# File 'lib/what_to_watch/show.rb', line 2

def title
  @title
end

#urlObject

Returns the value of attribute url.



2
3
4
# File 'lib/what_to_watch/show.rb', line 2

def url
  @url
end

Class Method Details

.filter(selection) ⇒ Object



19
20
21
# File 'lib/what_to_watch/show.rb', line 19

def self.filter(selection)
  @@filtered = @@all.select{|object| object.category.include?("#{selection}")}
end

.filteredObject



23
24
25
# File 'lib/what_to_watch/show.rb', line 23

def self.filtered
  @@filtered
end