Feature #307
ActiveFedora::Base should provide a label setter.
| Status: | Closed | Start: | 06/05/2009 | |
| Priority: | Normal | Due date: | ||
| Assigned to: | % Done: | 0% |
||
| Category: | Refining ActiveFedora API | Spent time: | 0.25 hours | |
| Target version: | 1.0.4 Refinements and Update to Fedora 3.2 | |||
| Sponsor: |
Description
ActiveFedora::Base should provide a label setter that sets the inner object's label. It already provides a label getter that reads from the inner object's label.
This missing method was caught by Bess in an email to the list:
Hey, folks. I'm in the process of trying to use ActiveFedora and
hopefully write a tutorial for new users. One snag I've been hitting
is that when I create a new object and then want to go look at it in
the fedora admin client, my objects never have labels. I just figured
out how to add them and thought I'd document it.
Given a class that uses ActiveFedora::Base, it seems like I should be
able to say b.label = "my label" but you can't:
b.label = "my label"
NoMethodError: undefined method `label=' for #<Bov:0x3aedb04>
from (irb):96
I was confused by this, because calling public_methods on an
ActiveFedora object shows a label method. But poking through the
source code I realized that what I actually have to do is:
b.inner_object.label = "my label"
=> "my label"
Then, if you've set it that way, it's now accessible via the label
method:
b.label
=> "my label"
And once you set it, indeed your fedora objects display their labels
in the fedora admin client.
Mystery solved!
Bess
History
Updated by Matt Zumwalt 415 days ago
- Target version set to 1.0.4 Refinements and Update to Fedora 3.2