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
42 43 44 |
# File 'lib/wordmove/hook.rb', line 42 def action @action end |
#options ⇒ Object
Returns the value of attribute options
42 43 44 |
# File 'lib/wordmove/hook.rb', line 42 def @options end |
#step ⇒ Object
Returns the value of attribute step
42 43 44 |
# File 'lib/wordmove/hook.rb', line 42 def step @step end |
Instance Method Details
#all_commands ⇒ Object
47 48 49 50 51 |
# File 'lib/wordmove/hook.rb', line 47 def all_commands return [] if empty_step? [action][step] || [] end |
#empty? ⇒ Boolean
43 44 45 |
# File 'lib/wordmove/hook.rb', line 43 def empty? all_commands.empty? end |
#local_commands ⇒ Object
53 54 55 56 57 58 |
# File 'lib/wordmove/hook.rb', line 53 def local_commands return [] if empty_step? [action][step] .select { |hook| hook[:where] == 'local' } || [] end |
#remote_commands ⇒ Object
60 61 62 63 64 65 |
# File 'lib/wordmove/hook.rb', line 60 def remote_commands return [] if empty_step? [action][step] .select { |hook| hook[:where] == 'remote' } || [] end |