Class: GitHub::Markup::Implementation

Inherits:
Object
  • Object
show all
Defined in:
lib/github/markup/implementation.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(regexp) ⇒ Implementation

Returns a new instance of Implementation.



6
7
8
# File 'lib/github/markup/implementation.rb', line 6

def initialize(regexp)
  @regexp = regexp
end

Instance Attribute Details

#regexpObject (readonly)

Returns the value of attribute regexp.



4
5
6
# File 'lib/github/markup/implementation.rb', line 4

def regexp
  @regexp
end

Instance Method Details

#loadObject



10
11
12
# File 'lib/github/markup/implementation.rb', line 10

def load
  # no-op by default
end

#match?(filename) ⇒ Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/github/markup/implementation.rb', line 18

def match?(filename)
  file_ext_regexp =~ filename
end

#render(content) ⇒ Object

Raises:

  • (NotImplementedError)


14
15
16
# File 'lib/github/markup/implementation.rb', line 14

def render(content)
  raise NotImplementedError, "subclasses of GitHub::Markup::Implementation must define #render"
end