Class: Sbuilder::LoaderPluginRoot

Inherits:
Object
  • Object
show all
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

ApiLoaderPlugin, SnippetLoaderPlugin

Constant Summary collapse

PROGNAME =

progname for logger default class name

nil

Constants included from Utils::MyLogger

Utils::MyLogger::LOGFILE

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Utils::MyLogger

#getLogger, #logfile

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( options = {} )
  
  @logger = getLogger( PROGNAME, options )
  @logger.info( "#{__method__} initialized, options=#{options}" )
  
  
end

Class Method Details

.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

Returns:



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

#loggerLogger

Returns log to Sbuiler log-file.

Returns:

  • (Logger)

    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



49
50
51
# File 'lib/sbuilder/facade/loader_plugin_root.rb', line 49

def oneOf( defintionHash, propList, min=1, max=1 )
  Sbuilder::Utils::Validate.oneOf( defintionHash, propList, min, max )
end

#validateProperties(hash, required_props, allowed_props) ⇒ Object



45
46
47
# File 'lib/sbuilder/facade/loader_plugin_root.rb', line 45

def validateProperties( hash, required_props, allowed_props )
  self.class.validateProperties( hash, required_props, allowed_props )      
end