Class: Rouge::Guessers::Mimetype
- Inherits:
-
Rouge::Guesser
- Object
- Rouge::Guesser
- Rouge::Guessers::Mimetype
- Defined in:
- lib/rouge/guessers/mimetype.rb
Instance Attribute Summary collapse
-
#mimetype ⇒ Object
readonly
Returns the value of attribute mimetype.
Instance Method Summary collapse
- #filter(lexers) ⇒ Object
-
#initialize(mimetype) ⇒ Mimetype
constructor
A new instance of Mimetype.
Methods inherited from Rouge::Guesser
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
#mimetype ⇒ Object (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 |