diff options
Diffstat (limited to 'lib/puppet/relationship.rb')
-rw-r--r-- | lib/puppet/relationship.rb | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/lib/puppet/relationship.rb b/lib/puppet/relationship.rb index cbd15b2af..879beeab7 100644 --- a/lib/puppet/relationship.rb +++ b/lib/puppet/relationship.rb @@ -11,15 +11,23 @@ require 'puppet/gratr' class Puppet::Relationship < GRATR::Edge # Return the callback def callback - label[:callback] + if label + label[:callback] + else + nil + end end # Return our event. def event - label[:event] + if label + label[:event] + else + nil + end end - def initialize(source, target, label = nil) + def initialize(source, target, label = {}) if label unless label.is_a?(Hash) raise Puppet::DevError, "The label must be a hash" @@ -46,6 +54,10 @@ class Puppet::Relationship < GRATR::Edge return false end end + + def ref + "%s => %s" % [source.ref, target.ref] + end end # $Id$ |