Class: SubtitleIt::Movie

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

Constant Summary collapse

EXTS =
%w(3g2 3gp 3gp2 3gpp 60d ajp asf asx avchd avi bik bix box cam dat divx dmf dv dvr-ms evo flc fli flic flv flx gvi gvp h264 m1v m2p m2ts m2v m4e m4v mjp mjpeg mjpg mkv moov mov movhd movie movx mp4 mpe mpeg mpg mpv mpv2 mxf nsv nut ogg ogm omf ps qt ram rm rmvb swf ts vfw vid video viv vivo vob vro wm wmv wmx wrap wvx wx x264 xvid)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(filename) ⇒ Movie

Returns a new instance of Movie.



11
12
13
14
15
# File 'lib/subtitle_it/movie.rb', line 11

def initialize(filename)
  @filename = filename
  @haxx = nil
  @info = {}
end

Instance Attribute Details

#filenameObject (readonly)

Returns the value of attribute filename.



8
9
10
# File 'lib/subtitle_it/movie.rb', line 8

def filename
  @filename
end

#infoObject

Returns the value of attribute info.



9
10
11
# File 'lib/subtitle_it/movie.rb', line 9

def info
  @info
end

Instance Method Details

#haxxObject



17
18
19
# File 'lib/subtitle_it/movie.rb', line 17

def haxx
  @haxx ||= MovieHasher::compute_haxx(@filename)
end

#sizeObject



21
22
23
# File 'lib/subtitle_it/movie.rb', line 21

def size
  File.size(@filename)
end