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

Make a "lazy" lens #7

Open
bmaddy opened this issue Mar 20, 2014 · 0 comments
Open

Make a "lazy" lens #7

bmaddy opened this issue Mar 20, 2014 · 0 comments

Comments

@bmaddy
Copy link
Contributor

bmaddy commented Mar 20, 2014

It would be nice to only load certain attributes when they are requested. We might be able to do this by having each of our lenses return and operate on an enumerator instead of a value (we probably want to do this on the FedoraLens::Lens class). This way we could specify some model loads as being lazy like this:

# current way
attribute :related_item_title, [RDF::DC11.relation, Lenses.load_model(:some_class), RDF::DC11.title
# lazy way
attribute :related_item_title, [RDF::DC11.relation, Lenses.lazily, Lenses.load_model(:some_class), RDF::DC11.title

The related model would be loaded lazily when we call obj.related_item_title.

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

No branches or pull requests

1 participant