class Epuber::CheckerTransformerBase
Attributes
block[R]
@return [Proc]
options[R]
List of options/flags passed in from plugin instance
@return [Array<Symbol>]
source_type[R]
Type of source value for this checker, valid values are:
:result_text_xhtml_string just before writing result xhtml to build folder
@return [Symbol]
Public Class Methods
class_for_source_type(type)
click to toggle source
@param [Symbol] type
@return [Class]
# File lib/epuber/checker_transformer_base.rb, line 62 def self.class_for_source_type(type) checker_class = map_source_type__class[type] raise "#{self} class not found for type: #{type.inspect}" if checker_class.nil? checker_class end
map_source_type__class()
click to toggle source
@return [Hash<Symbol, Class>]
# File lib/epuber/checker_transformer_base.rb, line 54 def self.map_source_type__class {} end
new(type, *options, &block)
click to toggle source
@param [Symbol] type type of checker, see type @param [Array<Symbol>] options list of other arguments, usually flags
# File lib/epuber/checker_transformer_base.rb, line 26 def initialize(type, *options, &block) @source_type = type @block = block valid_options_inst = valid_options options.each do |opt| raise "Unknown option #{opt.inspect}" unless valid_options_inst.include?(opt) end @options = options end
Public Instance Methods
call(*args)
click to toggle source
# File lib/epuber/checker_transformer_base.rb, line 43 def call(*args) raise NotImplementedError, 'You should override this method' end
valid_options()
click to toggle source
@return [Array<Symbol>]
# File lib/epuber/checker_transformer_base.rb, line 39 def valid_options [:run_only_before_release] end