Skip to content

Commit 457023a

Browse files
committed
Fixed rubocop MethodMissing while still preventing exceptions when an environment variable is undefined
1 parent 229b137 commit 457023a

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

.rubocop.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,6 @@ Metrics/PerceivedComplexity:
2121
Max: 10
2222
Metrics/AbcSize:
2323
Max: 29
24+
Style/MethodMissing:
25+
Exclude:
26+
- 'libraries/process_env_var.rb'

libraries/process_env_var.rb

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,7 @@ def initialize(process)
2929
end
3030

3131
def method_missing(name)
32-
if read_params[name]
33-
read_params[name.to_s]
34-
else
35-
''
36-
end
32+
read_params[name.to_s] || ''
3733
end
3834

3935
def read_params

0 commit comments

Comments
 (0)