Skip to content

add an 'only' option#3

Merged
phoet merged 1 commit intomasterfrom
allow_only_to_just_use_secific_key
Jan 15, 2017
Merged

add an 'only' option#3
phoet merged 1 commit intomasterfrom
allow_only_to_just_use_secific_key

Conversation

@phoet
Copy link
Owner

@phoet phoet commented Jan 13, 2017

@alto added a companion to the :ignore key

keys << block.binding.local_variables.map do |name|
next if ignore.include?(name)
[name, block.binding.local_variable_get(name)]
def memo(only: [], ignore: [], &block)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. Just wondering if we should rename ignore to except, as it's the naming pattern found in Rails & Co.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i thought of that too, i'll make another PR to introduce the change

@phoet phoet merged commit 82586bf into master Jan 15, 2017
@phoet phoet deleted the allow_only_to_just_use_secific_key branch January 24, 2017 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants