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.
5 6 7 |
# File 'lib/rouge/guessers/mimetype.rb', line 5 def initialize(mimetype) @mimetype = mimetype end |
Instance Attribute Details
#mimetype ⇒ Object (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 |