Class: R2OAS::Plugin::Base
- Extended by:
- Hookable
- Defined in:
- lib/r2-oas/plugin/base.rb
Direct Known Subclasses
Class Attribute Summary collapse
-
.opts ⇒ Object
Returns the value of attribute opts.
-
.plugin_name ⇒ Object
Returns the value of attribute plugin_name.
-
.type ⇒ Object
Returns the value of attribute type.
Class Method Summary collapse
- .execute_setup(*args) ⇒ Object
- .execute_teardown(*args) ⇒ Object
- .inherited(base) ⇒ Object
- .setup(&block) ⇒ Object
- .teardown(&block) ⇒ Object
Methods included from Hookable
execute_hook, has_hook?, hook_klass, hook_klass=, hooks, hooks_map, off, on
Methods inherited from Base
Constructor Details
This class inherits a constructor from R2OAS::Base
Class Attribute Details
.opts ⇒ Object
Returns the value of attribute opts.
13 14 15 |
# File 'lib/r2-oas/plugin/base.rb', line 13 def opts @opts end |
.plugin_name ⇒ Object
Returns the value of attribute plugin_name.
13 14 15 |
# File 'lib/r2-oas/plugin/base.rb', line 13 def plugin_name @plugin_name end |
.type ⇒ Object
Returns the value of attribute type.
13 14 15 |
# File 'lib/r2-oas/plugin/base.rb', line 13 def type @type end |
Class Method Details
.execute_setup(*args) ⇒ Object
29 30 31 |
# File 'lib/r2-oas/plugin/base.rb', line 29 def execute_setup(*args) execute_hook(:setup, *args) end |
.execute_teardown(*args) ⇒ Object
33 34 35 |
# File 'lib/r2-oas/plugin/base.rb', line 33 def execute_teardown(*args) execute_hook(:teardown, *args) end |
.inherited(base) ⇒ Object
37 38 39 40 |
# File 'lib/r2-oas/plugin/base.rb', line 37 def inherited(base) super base.opts = {} end |
.setup(&block) ⇒ Object
15 16 17 18 19 20 |
# File 'lib/r2-oas/plugin/base.rb', line 15 def setup(&block) return unless block_given? callback = proc { |*args| block.call(*args) } on(:setup, callback) end |
.teardown(&block) ⇒ Object
22 23 24 25 26 27 |
# File 'lib/r2-oas/plugin/base.rb', line 22 def teardown(&block) return unless block_given? callback = proc { |*args| block.call(*args) } on(:teardown, callback) end |