Sha256: 03722f7d6a740776e2d86f2e00554a1aa172ba3060a9271c8fb88681b9105918

Contents?: true

Size: 1.44 KB

Versions: 3

Compression:

Stored size: 1.44 KB

Contents

module Sbuilder

  # Abstract base class for loader plugins
  #
  # Known child classes: ApiLoaderPlugin, SnippetLoaderPlugin
  
  class LoaderPluginRoot

    PROGNAME = nil                       # progname for logger default class name
    include Sbuilder::Utils::MyLogger    # mix logger

    def initialize( options = {} )
      
      @logger = getLogger( PROGNAME, options )
      @logger.info( "#{__method__} initialized, options=#{options}" )
      
      
    end


    # #configure method called by controller
    #
    # @return [LoaderPluginRoot] self
    #
    def configure( configuration )
      doConfigure( configuration )
      self
    end

    # base class should implement 'doConfigure'
    def doConfigure( configuration )
      warn "Pluging '#{self.class.to_s}' should implement doConfigure"
    end

    # @return [Logger] log to Sbuiler log-file
    def logger
      @logger
    end

    def self.validateProperties( hash, required_props, allowed_props )
      Sbuilder::Utils::Validate.validateProperties( hash, required_props, allowed_props )      
    end

    def self.baseMetatypes
      Sbuilder::Controller.baseMetatypes
    end

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

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

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
tla-sbuilder-0.3.9 lib/sbuilder/facade/loader_plugin_root.rb
tla-sbuilder-0.3.8 lib/sbuilder/facade/loader_plugin_root.rb
tla-sbuilder-0.3.7 lib/sbuilder/facade/loader_plugin_root.rb