lib/screengem/actor.rb in screengem-0.7.1 vs lib/screengem/actor.rb in screengem-0.7.2
- old
+ new
@@ -43,9 +43,16 @@
#
# Used by an actor to recall a value for the specified tag.
#
def recall(tag, reload: true)
+ unless recollections.key?(tag)
+ raise <<~MSG
+ #{name} does not recall #{tag}
+ #{name} recalls: #{recollections.keys.to_sentence}
+ MSG
+ end
+
recollections.fetch(tag).tap do |value|
value.reload if reload && value.respond_to?(:reload)
end
end