Last active
December 20, 2015 10:30
-
-
Save ggolin/6115568 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# resources/foo.rb | |
attribute :x, :kind_of => String, :default => nil | |
# providers/foo.rb | |
x = new_resource.x.nil? ? new_resource.name : new_resource.x | |
# providers/bar.rb | |
foo new_resource.name do | |
x "foobar" | |
end | |
# x always ends up as "schlep". |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The ternary operator is basically doing this: