Class: Epuber::CheckerTransformerBase
- Inherits:
-
Object
- Object
- Epuber::CheckerTransformerBase
- Defined in:
- lib/epuber/checker_transformer_base.rb
Direct Known Subclasses
Instance Attribute Summary collapse
- #block ⇒ Proc readonly
-
#options ⇒ Array<Symbol>
readonly
List of options/flags passed in from plugin instance.
-
#source_type ⇒ Symbol
readonly
Type of source value for this checker, valid values are: :result_text_xhtml_string just before writing result xhtml to build folder.
Registration collapse
Instance Method Summary collapse
- #call(*args) ⇒ Object
-
#initialize(type, *options, &block) ⇒ CheckerTransformerBase
constructor
A new instance of CheckerTransformerBase.
- #valid_options ⇒ Array<Symbol>
Constructor Details
#initialize(type, *options, &block) ⇒ CheckerTransformerBase
Returns a new instance of CheckerTransformerBase.
26 27 28 29 30 31 32 33 34 35 |
# File 'lib/epuber/checker_transformer_base.rb', line 26 def initialize(type, *, &block) @source_type = type @block = block = .each do |opt| raise "Unknown option #{opt.inspect}" unless .include?(opt) end @options = end |
Instance Attribute Details
#block ⇒ Proc (readonly)
20 21 22 |
# File 'lib/epuber/checker_transformer_base.rb', line 20 def block @block end |
#options ⇒ Array<Symbol> (readonly)
List of options/flags passed in from plugin instance
16 17 18 |
# File 'lib/epuber/checker_transformer_base.rb', line 16 def @options end |
#source_type ⇒ Symbol (readonly)
Type of source value for this checker, valid values are:
:result_text_xhtml_string just before writing result xhtml to build folder
10 11 12 |
# File 'lib/epuber/checker_transformer_base.rb', line 10 def source_type @source_type end |
Class Method Details
.class_for_source_type(type) ⇒ Class
62 63 64 65 66 67 |
# 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 ⇒ Hash<Symbol, Class>
54 55 56 |
# File 'lib/epuber/checker_transformer_base.rb', line 54 def self.map_source_type__class {} end |
Instance Method Details
#call(*args) ⇒ Object
43 44 45 |
# File 'lib/epuber/checker_transformer_base.rb', line 43 def call(*args) raise NotImplementedError, 'You should override this method' end |
#valid_options ⇒ Array<Symbol>
39 40 41 |
# File 'lib/epuber/checker_transformer_base.rb', line 39 def [:run_only_before_release] end |