lib/bio-publisci/metadata/prov/agent.rb in bio-publisci-0.0.4 vs lib/bio-publisci/metadata/prov/agent.rb in bio-publisci-0.0.5
- old
+ new
@@ -39,19 +39,20 @@
def organization=(organization)
@organization = organization
end
- def on_behalf_of(agent=nil)
- if agent
- if agent.is_a? Symbol
- raise "UnknownAgent: #{agent}" unless Prov.agents.has_key?(agent)
- agent = Prov.agents[agent]
- end
- @on_behalf_of = agent
+ def on_behalf_of(other_agent=nil)
+ if other_agent
+ @on_behalf_of = other_agent
+ elsif @on_behalf_of.is_a? Symbol
+ raise "UnknownAgent: #{@on_behalf_of}" unless Prov.agents.has_key?(@on_behalf_of)
+ @on_behalf_of = Prov.agents[@on_behalf_of]
else
@on_behalf_of
end
+
+ @on_behalf_of
end
alias_method :worked_for, :on_behalf_of
def to_n3
str = "<#{subject}> a prov:Agent"
\ No newline at end of file