Commit bfed284d97a5bba34a569e70e655e2f9ae96ea53

Authored by Rodrigo Souto
1 parent 5cf344eb

Removing unecessary initialize from presenters

app/presenters/generic.rb
1 1 # Made to encapsulate any UploadedFile
2 2 class FilePresenter::Generic < FilePresenter
3   - def initialize(f)
4   - @file = f
5   - end
6   -
7 3 # if returns low priority, because it is generic.
8 4 def self.accepts?(f)
9 5 1 if f.is_a? UploadedFile
... ...
app/presenters/image.rb
1 1 class FilePresenter::Image < FilePresenter
2   - def initialize(f)
3   - @file = f
4   - end
5   -
6 2 def self.accepts?(f)
7 3 return nil unless f.respond_to? :image?
8 4 f.image? ? 10 : nil
... ...
plugins/html5_video/lib/file_presenter/video.rb
1 1 class FilePresenter::Video < FilePresenter
2   - def initialize(f)
3   - @file = f
4   - end
5   -
6 2 def self.accepts?(f)
7 3 return nil if !f.respond_to?(:content_type) || f.content_type.nil?
8 4 ( f.content_type[0..4] == 'video' ) ? 10 : nil
... ...