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
class Bola | |
def initialize(cor) | |
@cor = cor | |
end | |
attr_accessor :cor | |
end |
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
class ParamsSlicer | |
def initialize(params, *whitelist) | |
@params = params | |
@nested_whitelist = whitelist.extract_options! | |
@whitelist = whitelist | |
end | |
def call | |
params.slice(*whitelist).tap do |result| | |
nested_whitelist.each do |k, v| |