Class: Rouge::Guessers::Mimetype

Inherits:
Rouge::Guesser show all
Defined in:
lib/rouge/guessers/mimetype.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Rouge::Guesser

#collect_best, guess

Constructor Details

#initialize(mimetype) ⇒ Mimetype

Returns a new instance of Mimetype


7
8
9
# File 'lib/rouge/guessers/mimetype.rb', line 7

def initialize(mimetype)
  @mimetype = mimetype
end

Instance Attribute Details

#mimetypeObject (readonly)

Returns the value of attribute mimetype


6
7
8
# File 'lib/rouge/guessers/mimetype.rb', line 6

def mimetype
  @mimetype
end

Instance Method Details

#filter(lexers) ⇒ Object


11
12
13
# File 'lib/rouge/guessers/mimetype.rb', line 11

def filter(lexers)
  lexers.select { |lexer| lexer.mimetypes.include? @mimetype }
end