Class: BangBang::Plugins::Set
- Inherits:
-
Object
- Object
- BangBang::Plugins::Set
- Defined in:
- lib/bang-bang/plugins.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Instance Method Summary collapse
- #init ⇒ Object
-
#initialize(config) ⇒ Set
constructor
A new instance of Set.
- #on_init(&block) ⇒ Object
Constructor Details
#initialize(config) ⇒ Set
Returns a new instance of Set.
5 6 7 |
# File 'lib/bang-bang/plugins.rb', line 5 def initialize(config) @config = config end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
4 5 6 |
# File 'lib/bang-bang/plugins.rb', line 4 def config @config end |
Instance Method Details
#init ⇒ Object
18 19 20 21 22 |
# File 'lib/bang-bang/plugins.rb', line 18 def init self.on_init.each do |block| block.call(config) end end |
#on_init(&block) ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/bang-bang/plugins.rb', line 9 def on_init(&block) @on_init ||= [] if block @on_init.push(block) else @on_init end end |