Class: MovieRenamer::Movie
- Inherits:
-
Object
- Object
- MovieRenamer::Movie
- Defined in:
- lib/movie-renamer/movie.rb
Instance Attribute Summary collapse
-
#director ⇒ Object
Returns the value of attribute director.
-
#filename ⇒ Object
Returns the value of attribute filename.
-
#imdb ⇒ Object
Returns the value of attribute imdb.
-
#part ⇒ Object
Returns the value of attribute part.
-
#title ⇒ Object
Returns the value of attribute title.
-
#year ⇒ Object
Returns the value of attribute year.
Instance Method Summary collapse
- #==(movie) ⇒ Object
-
#initialize(filename, opts = {}) ⇒ Movie
constructor
A new instance of Movie.
Constructor Details
#initialize(filename, opts = {}) ⇒ Movie
Returns a new instance of Movie.
5 6 7 8 9 10 11 12 13 |
# File 'lib/movie-renamer/movie.rb', line 5 def initialize(filename,opts={}) opts = { :year => '', :director => '', :title => '', :part => '', :imdb =>''}.merge(opts) @year = opts[:year] @director = opts[:director] @title = opts[:title] @part = opts[:part] @imdb = opts[:imdb] @filename = filename end |
Instance Attribute Details
#director ⇒ Object
Returns the value of attribute director.
15 16 17 |
# File 'lib/movie-renamer/movie.rb', line 15 def director @director end |
#filename ⇒ Object
Returns the value of attribute filename.
15 16 17 |
# File 'lib/movie-renamer/movie.rb', line 15 def filename @filename end |
#imdb ⇒ Object
Returns the value of attribute imdb.
15 16 17 |
# File 'lib/movie-renamer/movie.rb', line 15 def imdb @imdb end |
#part ⇒ Object
Returns the value of attribute part.
15 16 17 |
# File 'lib/movie-renamer/movie.rb', line 15 def part @part end |
#title ⇒ Object
Returns the value of attribute title.
15 16 17 |
# File 'lib/movie-renamer/movie.rb', line 15 def title @title end |
#year ⇒ Object
Returns the value of attribute year.
15 16 17 |
# File 'lib/movie-renamer/movie.rb', line 15 def year @year end |
Instance Method Details
#==(movie) ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/movie-renamer/movie.rb', line 17 def == (movie) if @year == movie.year and @director == movie.director and @title == movie.title and @part == movie.part and @imdb == movie.imdb and @filename == movie.filename return true else return false end end |