Class: NowPlaying::Movie
- Inherits:
-
Object
- Object
- NowPlaying::Movie
- Defined in:
- lib/now_playing/movie.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#stars ⇒ Object
Returns the value of attribute stars.
-
#summary ⇒ Object
Returns the value of attribute summary.
-
#url ⇒ Object
Returns the value of attribute url.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(name = nil, url = nil) ⇒ Movie
constructor
A new instance of Movie.
Constructor Details
#initialize(name = nil, url = nil) ⇒ Movie
Returns a new instance of Movie.
4 5 6 7 |
# File 'lib/now_playing/movie.rb', line 4 def initialize(name = nil, url = nil) @name = name @url = url end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
2 3 4 |
# File 'lib/now_playing/movie.rb', line 2 def name @name end |
#stars ⇒ Object
Returns the value of attribute stars.
2 3 4 |
# File 'lib/now_playing/movie.rb', line 2 def stars @stars end |
#summary ⇒ Object
Returns the value of attribute summary.
2 3 4 |
# File 'lib/now_playing/movie.rb', line 2 def summary @summary end |
#url ⇒ Object
Returns the value of attribute url.
2 3 4 |
# File 'lib/now_playing/movie.rb', line 2 def url @url end |
Class Method Details
.all ⇒ Object
9 10 11 |
# File 'lib/now_playing/movie.rb', line 9 def self.all @@all ||= end |
.find(id) ⇒ Object
13 14 15 |
# File 'lib/now_playing/movie.rb', line 13 def self.find(id) self.all[id-1] end |
.find_by_name(name) ⇒ Object
17 18 19 20 21 22 |
# File 'lib/now_playing/movie.rb', line 17 def self.find_by_name(name) self.all.detect do |m| m.name.downcase.strip == name.downcase.strip || m.name.split("(").first.strip.downcase == name.downcase.strip end end |