class Epuber::Plugin::PluginFile
Attributes
instances[R]
@return [Array]
Public Class Methods
new(file_path)
click to toggle source
@param [String] file_path path to plugin file
Calls superclass method
Epuber::Compiler::FileTypes::SourceFile::new
# File lib/epuber/plugin.rb, line 17 def initialize(file_path) super(file_path) @instances = [] eval(::File.read(file_path), binding, file_path) end
plugin_instance_function(name, klass)
click to toggle source
@param [Symbol] name name of the plugin function @param [Class] klass class of what it should create
@return nil
# File lib/epuber/plugin.rb, line 29 def self.plugin_instance_function(name, klass) define_method(name) do |source_type, *options, &block| checker_class = klass.class_for_source_type(source_type) checker = checker_class.new(source_type, *options, &block) instances << checker checker end end