Class: Sbuilder::LoaderPluginRoot
- Inherits:
-
Object
- Object
- Sbuilder::LoaderPluginRoot
- Includes:
- Utils::MyLogger
- Defined in:
- lib/sbuilder/facade/loader_plugin_root.rb
Overview
Abstract base class for loader plugins
Known child classes: ApiLoaderPlugin, SnippetLoaderPlugin
Direct Known Subclasses
Constant Summary collapse
- PROGNAME =
progname for logger default class name
nil
Constants included from Utils::MyLogger
Class Method Summary collapse
Instance Method Summary collapse
-
#configure(configuration) ⇒ LoaderPluginRoot
#configure method called by controller.
-
#doConfigure(configuration) ⇒ Object
base class should implement ‘doConfigure’.
-
#initialize(options = {}) ⇒ LoaderPluginRoot
constructor
A new instance of LoaderPluginRoot.
-
#logger ⇒ Logger
Log to Sbuiler log-file.
- #oneOf(defintionHash, propList, min = 1, max = 1) ⇒ Object
- #validateProperties(hash, required_props, allowed_props) ⇒ Object
Methods included from Utils::MyLogger
Constructor Details
#initialize(options = {}) ⇒ LoaderPluginRoot
Returns a new instance of LoaderPluginRoot.
12 13 14 15 16 17 18 |
# File 'lib/sbuilder/facade/loader_plugin_root.rb', line 12 def initialize( = {} ) @logger = getLogger( PROGNAME, ) @logger.info( "#{__method__} initialized, options=#{options}" ) end |
Class Method Details
.baseMetatypes ⇒ Object
44 45 46 |
# File 'lib/sbuilder/facade/loader_plugin_root.rb', line 44 def self.baseMetatypes Sbuilder::Controller.baseMetatypes end |
.validateProperties(hash, required_props, allowed_props) ⇒ Object
40 41 42 |
# File 'lib/sbuilder/facade/loader_plugin_root.rb', line 40 def self.validateProperties( hash, required_props, allowed_props ) Sbuilder::Utils::Validate.validateProperties( hash, required_props, allowed_props ) end |
Instance Method Details
#configure(configuration) ⇒ LoaderPluginRoot
#configure method called by controller
25 26 27 28 |
# File 'lib/sbuilder/facade/loader_plugin_root.rb', line 25 def configure( configuration ) doConfigure( configuration ) self end |
#doConfigure(configuration) ⇒ Object
base class should implement ‘doConfigure’
31 32 33 |
# File 'lib/sbuilder/facade/loader_plugin_root.rb', line 31 def doConfigure( configuration ) warn "Pluging '#{self.class.to_s}' should implement doConfigure" end |
#logger ⇒ Logger
Returns log to Sbuiler log-file.
36 37 38 |
# File 'lib/sbuilder/facade/loader_plugin_root.rb', line 36 def logger @logger end |
#oneOf(defintionHash, propList, min = 1, max = 1) ⇒ Object
52 53 54 |
# File 'lib/sbuilder/facade/loader_plugin_root.rb', line 52 def oneOf( defintionHash, propList, min=1, max=1 ) Sbuilder::Utils::Validate.oneOf( defintionHash, propList, min, max ) end |
#validateProperties(hash, required_props, allowed_props) ⇒ Object
48 49 50 |
# File 'lib/sbuilder/facade/loader_plugin_root.rb', line 48 def validateProperties( hash, required_props, allowed_props ) self.class.validateProperties( hash, required_props, allowed_props ) end |