Class: Blocks::HookDefinition

Inherits:
OptionsSet
  • Object
show all
Defined in:
lib/blocks/builders/hook_definition.rb

Constant Summary collapse

BEFORE_ALL =
:before_all
AROUND_ALL =
:around_all
BEFORE =
:before
AROUND =
:around
SURROUND =
:surround
PREPEND =
:prepend
APPEND =
:append
AFTER =
:after
AFTER_ALL =
:after_all
HOOKS =
[BEFORE_ALL, BEFORE, PREPEND,
AROUND_ALL, AROUND, SURROUND,
APPEND, AFTER, AFTER_ALL]

Instance Attribute Summary collapse

Attributes inherited from OptionsSet

#default_options, #name, #runtime_options, #standard_options

Instance Method Summary collapse

Methods inherited from OptionsSet

#add_options, #current_render_strategy_and_item, #initialize_copy, #inspect, #nested_under_indifferent_access, #render_strategies_and_items, #reset, #to_s

Constructor Details

#initialize(block_definition, hook_type, *args, &block) ⇒ HookDefinition

Returns a new instance of HookDefinition.



19
20
21
22
23
# File 'lib/blocks/builders/hook_definition.rb', line 19

def initialize(block_definition, hook_type, *args, &block)
  self.block_definition = block_definition
  self.hook_type = hook_type
  super "#{hook_type} #{block_definition.name} options", *args, &block
end

Instance Attribute Details

#block_definitionObject

Returns the value of attribute block_definition.



17
18
19
# File 'lib/blocks/builders/hook_definition.rb', line 17

def block_definition
  @block_definition
end

#hook_typeObject

Returns the value of attribute hook_type.



17
18
19
# File 'lib/blocks/builders/hook_definition.rb', line 17

def hook_type
  @hook_type
end