Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #30781 - app_value() should expect Symbol #275

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions lib/kafo/hook_context.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,16 @@ def app_option(*args)
# Returns whether the given app option exists. This is useful when there's a conditional option that is
# determined during boot; this helper can be used in later hooks to determine whether the option exists.
def app_option?(option)
self.kafo.config.app.key?(option.to_sym)
raise "Invalid input: #{option} : app_option?() expects Symbol argument" unless option.is_a?(Symbol)
self.kafo.config.app.key?(option)
end

# examples:
# app_value(:log_level)
# note the dash to underscore convention
def app_value(option)
self.kafo.config.app[option.to_sym]
raise "Invalid input: #{option} : app_value() expects Symbol argument" unless option.is_a?(Symbol)
self.kafo.config.app[option]
end

# examples:
Expand Down