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.



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

def initialize(mimetype)
  @mimetype = mimetype
end

Instance Attribute Details

#mimetypeObject (readonly)

Returns the value of attribute mimetype.



4
5
6
# File 'lib/rouge/guessers/mimetype.rb', line 4

def mimetype
  @mimetype
end

Instance Method Details

#filter(lexers) ⇒ Object



9
10
11
# File 'lib/rouge/guessers/mimetype.rb', line 9

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