Module: Sbuilder::SnippetLoaderPluginMixer

Included in:
SnippetLoaderPlugin
Defined in:
lib/sbuilder/facade/snippet_loader_plugin_mixer.rb

Overview

Mixer module to include to API loader plugins

Implement:

  • getter & setter for Snippet loader facade

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.validateProperties(hash, required_props, allowed_props) ⇒ Object

def validateProperties( hash, required_props, allowed_props )

SnippetLoaderPlugin.validateProperties( hash, required_props, allowed_props )

end



48
49
50
# File 'lib/sbuilder/facade/snippet_loader_plugin_mixer.rb', line 48

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

Instance Method Details

#registerMetatype(metatype, desc) ⇒ Object

A method available for plugin sub class, allowing sub class to register metatype prio



29
30
31
# File 'lib/sbuilder/facade/snippet_loader_plugin_mixer.rb', line 29

def registerMetatype( metatype, desc )
  snippetFacade.registerMetatype( metatype, desc )
end

#registerSnippets(snippetsDefs) ⇒ Object

load. snippetsDefs are passed un modified to plugin implementation

Parameters:

  • snippetsDefs (Hash)

    defining snippets to



37
38
39
40
41
# File 'lib/sbuilder/facade/snippet_loader_plugin_mixer.rb', line 37

def registerSnippets( snippetsDefs )
  # call implementation in concrete class
  logger.info "#{__method__}, snippetsDefs=#{snippetsDefs}"
  doRegisterSnippets( snippetsDefs  )
end

#setSnippetFacade(facade) ⇒ Object

Sbuilder controller calls ‘setFacade’ when new API loader object is contstructed. Sets instance variable ‘@facade’.

Parameters:



17
18
19
# File 'lib/sbuilder/facade/snippet_loader_plugin_mixer.rb', line 17

def setSnippetFacade( facade )
  @snippetFacade = facade
end

#snippetFacadeSbuilder::ApiLoaderFacade

Returns snippetFacade to access Sbuilder servivices ( set in ‘setFacade’).

Returns:



22
23
24
# File 'lib/sbuilder/facade/snippet_loader_plugin_mixer.rb', line 22

def snippetFacade
  @snippetFacade
end