class GitHub::Markup::CommandImplementation

Attributes

block[R]
command[R]
name[R]

Public Class Methods

new(regexp, languages, command, name, &block) click to toggle source
Calls superclass method
# File lib/github/markup/command_implementation.rb, line 18
def initialize(regexp, languages, command, name, &block)
  super(regexp, languages)
  @command = command.to_s
  @block = block
  @name = name
end

Public Instance Methods

render(filename, content) click to toggle source
# File lib/github/markup/command_implementation.rb, line 25
def render(filename, content)
  rendered = execute(command, content)
  rendered = rendered.to_s.empty? ? content : rendered
  call_block(rendered, content)
end