lib/bulldog/attachment/base.rb in bulldog-0.0.11 vs lib/bulldog/attachment/base.rb in bulldog-0.0.12
- old
+ new
@@ -143,9 +143,23 @@
#
def run_examination
true
end
+ #
+ # Return the value of the given attribute from an instance
+ # variable set during file examination.
+ #
+ # If not set, runs a file examination first.
+ #
+ def from_examination(name)
+ ivar = :"@#{name}"
+ value = instance_variable_get(ivar) and
+ return value
+ examine
+ instance_variable_get(ivar)
+ end
+
private # -------------------------------------------------------
#
# Remove the files for this attachment, along with any parent
# directories.