-
-
Notifications
You must be signed in to change notification settings - Fork 234
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
DRY - Code Refactor #310
DRY - Code Refactor #310
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ class YAMLSource | |
|
||
def initialize(path, evaluate_erb: Config.evaluate_erb_in_yaml) | ||
@path = path.to_s | ||
@evaluate_erb = !!evaluate_erb | ||
@evaluate_erb = evaluate_erb | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure about this one...it's kind of nice having a proper boolean, since it is accessible via the attr_reader. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm on the same page as you @Fryguy . Several of the changes proposed in this PR compromise correctness or readability in favor of succinctness. I'm comfortable with the |
||
end | ||
|
||
# returns a config hash from the YML file | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instance_of
is a strange name here, but I'm struggling coming up with a better name. To me,instance_of
implies you are getting another instance of something (perhaps a dup), but it's actually returning the converted value of the passed in value. PerhapsOnce that is changed, I was thinking you can also rename
descend_array
toserialize_array
to match the pattern, but now that I look at it, there's no longer a reason to have a separate method for handling an array, and it can probably be inlined directly into this method.