Class: Wordmove::Hook::Config

Inherits:
Struct
  • Object
show all
Defined in:
lib/wordmove/hook.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#actionObject

Returns the value of attribute action

Returns:

  • (Object)

    the current value of action



36
37
38
# File 'lib/wordmove/hook.rb', line 36

def action
  @action
end

#optionsObject

Returns the value of attribute options

Returns:

  • (Object)

    the current value of options



36
37
38
# File 'lib/wordmove/hook.rb', line 36

def options
  @options
end

#stepObject

Returns the value of attribute step

Returns:

  • (Object)

    the current value of step



36
37
38
# File 'lib/wordmove/hook.rb', line 36

def step
  @step
end

Instance Method Details

#empty?Boolean

Returns:

  • (Boolean)


37
38
39
# File 'lib/wordmove/hook.rb', line 37

def empty?
  (local_hooks + remote_hooks).empty?
end

#local_hooksObject



41
42
43
44
45
46
# File 'lib/wordmove/hook.rb', line 41

def local_hooks
  return [] if empty_step?

  options[action][step]
    .select { |hook| hook[:where] == 'local' } || []
end

#remote_hooksObject



48
49
50
51
52
53
# File 'lib/wordmove/hook.rb', line 48

def remote_hooks
  return [] if empty_step?

  options[action][step]
    .select { |hook| hook[:where] == 'remote' } || []
end