Class: Machined::Initializable::Initializer
- Inherits:
-
Struct
- Object
- Struct
- Machined::Initializable::Initializer
- Defined in:
- lib/machined/initializable.rb
Instance Attribute Summary collapse
-
#block ⇒ Object
Returns the value of attribute block.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
-
#run(context, *args) ⇒ Object
Run’s the initializer’s
block
with the givencontext
and yields the givenargs
to the block.
Instance Attribute Details
#block ⇒ Object
Returns the value of attribute block
16 17 18 |
# File 'lib/machined/initializable.rb', line 16 def block @block end |
#name ⇒ Object
Returns the value of attribute name
16 17 18 |
# File 'lib/machined/initializable.rb', line 16 def name @name end |
Instance Method Details
#run(context, *args) ⇒ Object
Run’s the initializer’s block
with the given context
and yields the given args
to the block.
20 21 22 |
# File 'lib/machined/initializable.rb', line 20 def run(context, *args) context.instance_exec(*args, &block) end |