Skip to content
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

support nested expose declarations #47

Closed
wants to merge 1 commit into from
Closed

support nested expose declarations #47

wants to merge 1 commit into from

Conversation

wyattisimo
Copy link
Contributor

See issue #34

Here's a first attempt at supporting nested exposures.

Note: Previously, any supplied block would be assigned to options[:proc] and called with the represented object and the runtime options. I used that fact as a delineation, so...

  1. If the supplied block has parameters, then it will be recognized as a Proc to determine the value of the exposure.
  2. If the supplied block has no parameters, then it will be understood that the block contains nested exposures.

This will break any implementations that supply Procs with no parameters.

@@ -399,6 +417,12 @@ def value_for(attribute, options = {})
elsif format_with.respond_to? :call
instance_exec(delegate_attribute(attribute), &format_with)
end

elsif !nested_exposures.empty?
Copy link
Member

Choose a reason for hiding this comment

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

Minor: elsif nested_exposures.any?

@dblock
Copy link
Member

dblock commented Jan 9, 2014

This looks very good. You should update README and CHANGELOG, please (via --amend).

@dblock
Copy link
Member

dblock commented Jan 10, 2014

Merged via 4284ee5, thank you.

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