# class GitHub::Markup::Implementation

### Attributes

languages[R]
regexp[R]

### Public Class Methods

new(regexp, languages) click to toggle source

    # File lib/github/markup/implementation.rb, line 7
    def initialize(regexp, languages)
      @regexp = regexp

      if defined?(::Linguist)
        @languages = languages.map do |l|
          lang = Linguist::Language[l]
          raise "no match for language #{l.inspect}" if lang.nil?
          lang
        end
      end
    end

### Public Instance Methods

load() click to toggle source

    # File lib/github/markup/implementation.rb, line 19
    def load
      # no-op by default
    end

match?(filename, language) click to toggle source

    # File lib/github/markup/implementation.rb, line 27
    def match?(filename, language)
      if defined?(::Linguist)
        languages.include? language
      else
        file_ext_regexp =~ filename
      end
    end

render(filename, content, options: {}) click to toggle source

    # File lib/github/markup/implementation.rb, line 23
    def render(filename, content, options: {})
      raise NotImplementedError, "subclasses of GitHub::Markup::Implementation must define #render"
    end