Class: MovieRenamer::Movie

Inherits:
Object
  • Object
show all
Defined in:
lib/movie-renamer/movie.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#directorObject

Returns the value of attribute director.



15
16
17
# File 'lib/movie-renamer/movie.rb', line 15

def director
  @director
end

#filenameObject

Returns the value of attribute filename.



15
16
17
# File 'lib/movie-renamer/movie.rb', line 15

def filename
  @filename
end

#imdbObject

Returns the value of attribute imdb.



15
16
17
# File 'lib/movie-renamer/movie.rb', line 15

def imdb
  @imdb
end

#partObject

Returns the value of attribute part.



15
16
17
# File 'lib/movie-renamer/movie.rb', line 15

def part
  @part
end

#titleObject

Returns the value of attribute title.



15
16
17
# File 'lib/movie-renamer/movie.rb', line 15

def title
  @title
end

#yearObject

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