Class: Talks::Hooks::Base
- Inherits:
-
Object
- Object
- Talks::Hooks::Base
show all
- Defined in:
- lib/talks/hooks/base.rb
Class Method Summary
collapse
Class Method Details
.default_message_method ⇒ Object
9
|
# File 'lib/talks/hooks/base.rb', line 9
def default_message_method; "default_#{message_method}"; end
|
.message_method ⇒ Object
8
|
# File 'lib/talks/hooks/base.rb', line 8
def message_method; :message_for; end
|
.message_name ⇒ Object
10
|
# File 'lib/talks/hooks/base.rb', line 10
def message_name; :before; end
|
.one_dash_argv ⇒ Object
6
|
# File 'lib/talks/hooks/base.rb', line 6
def one_dash_argv; ''; end
|
.to_hook(opts, cmd) ⇒ Object
12
13
14
15
16
|
# File 'lib/talks/hooks/base.rb', line 12
def to_hook(opts, cmd)
opts[one_dash_argv] || opts[two_dashes_argv] ||
Talks.config.send(message_method, cmd, message_name) ||
Talks.config.send(default_message_method, cmd, message_name)
end
|
.two_dashes_argv ⇒ Object
7
|
# File 'lib/talks/hooks/base.rb', line 7
def two_dashes_argv; ''; end
|