Class: Machined::Initializable::Initializer

Inherits:
Struct
  • Object
show all
Defined in:
lib/machined/initializable.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#blockObject

Returns the value of attribute block

Returns:

  • (Object)

    the current value of block



16
17
18
# File 'lib/machined/initializable.rb', line 16

def block
  @block
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of 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