Module: OpenapiFirst::Plugins
- Included in:
- OpenapiFirst
- Defined in:
- lib/openapi_first/plugins.rb,
lib/openapi_first/plugins/default.rb,
lib/openapi_first/plugins/jsonapi.rb,
lib/openapi_first/plugins/default/error_response.rb,
lib/openapi_first/plugins/jsonapi/error_response.rb
Overview
Plugin System adapted from Polished Ruby Programming by Jeremy Evans itunes.apple.com/WebObjects/MZStore.woa/wa/viewBook?id=0
Defined Under Namespace
Constant Summary collapse
- PLUGINS =
rubocop:disable Style/MutableConstant
{}
Instance Method Summary collapse
Instance Method Details
#plugin(name) ⇒ Object
14 15 16 17 |
# File 'lib/openapi_first/plugins.rb', line 14 def plugin(name) require "openapi_first/plugins/#{name}" PLUGINS.fetch(name) end |
#register(name, klass) ⇒ Object
10 11 12 |
# File 'lib/openapi_first/plugins.rb', line 10 def register(name, klass) PLUGINS[name] = klass end |