Class: Dexter::Matchers::AbstractMatcher

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

Direct Known Subclasses

Video

Constant Summary collapse

EXTENSIONS =
[]

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(filename) ⇒ AbstractMatcher

Returns a new instance of AbstractMatcher.



56
57
58
59
# File 'lib/dexter.rb', line 56

def initialize(filename)
  raise "Not an allowed format!" unless self.class.allowed?(filename)
  @filename = filename
end

Class Method Details

.allowed?(filename) ⇒ Boolean

Returns:

  • (Boolean)


52
53
54
# File 'lib/dexter.rb', line 52

def self.allowed?(filename) 
  self::EXTENSIONS.include? File.extname(filename).gsub(/^\./,"")
end

Instance Method Details

#extensionObject



65
66
67
# File 'lib/dexter.rb', line 65

def extension
  File.extname(@filename).gsub(/^\./,"")
end

#filenameObject



69
70
71
# File 'lib/dexter.rb', line 69

def filename
  @filename
end

#organize!Object



61
62
63
# File 'lib/dexter.rb', line 61

def organize!
  raise "It's up to the subclass to implement this"
end