Class: Wordmove::Hook::Config
- Inherits:
-
Struct
- Object
- Struct
- Wordmove::Hook::Config
- Defined in:
- lib/wordmove/hook.rb
Overview
rubocop:enable Metrics/MethodLength
Instance Attribute Summary collapse
-
#action ⇒ Object
Returns the value of attribute action.
-
#options ⇒ Object
Returns the value of attribute options.
-
#step ⇒ Object
Returns the value of attribute step.
Instance Method Summary collapse
Instance Attribute Details
#action ⇒ Object
Returns the value of attribute action
41 42 43 |
# File 'lib/wordmove/hook.rb', line 41 def action @action end |
#options ⇒ Object
Returns the value of attribute options
41 42 43 |
# File 'lib/wordmove/hook.rb', line 41 def @options end |
#step ⇒ Object
Returns the value of attribute step
41 42 43 |
# File 'lib/wordmove/hook.rb', line 41 def step @step end |
Instance Method Details
#all_commands ⇒ Object
46 47 48 49 50 |
# File 'lib/wordmove/hook.rb', line 46 def all_commands return [] if empty_step? [action][step] || [] end |
#empty? ⇒ Boolean
42 43 44 |
# File 'lib/wordmove/hook.rb', line 42 def empty? all_commands.empty? end |
#local_commands ⇒ Object
52 53 54 55 56 57 |
# File 'lib/wordmove/hook.rb', line 52 def local_commands return [] if empty_step? [action][step] .select { |hook| hook[:where] == 'local' } || [] end |
#remote_commands ⇒ Object
59 60 61 62 63 64 |
# File 'lib/wordmove/hook.rb', line 59 def remote_commands return [] if empty_step? [action][step] .select { |hook| hook[:where] == 'remote' } || [] end |