Module: Spandx::Core::Registerable
- Includes:
- Enumerable
- Included in:
- Spandx::Cli::Printer, Gateway, Parser, Plugin
- Defined in:
- lib/spandx/core/registerable.rb
Instance Method Summary collapse
Instance Method Details
#all ⇒ Object
8 9 10 |
# File 'lib/spandx/core/registerable.rb', line 8 def all @all ||= registry.map(&:new) end |
#each(&block) ⇒ Object
12 13 14 15 16 |
# File 'lib/spandx/core/registerable.rb', line 12 def each(&block) all.each do |x| block.call(x) end end |
#inherited(subclass) ⇒ Object
18 19 20 |
# File 'lib/spandx/core/registerable.rb', line 18 def inherited(subclass) registry.push(subclass) end |
#registry ⇒ Object
22 23 24 |
# File 'lib/spandx/core/registerable.rb', line 22 def registry @registry ||= [] end |