lib/detour/flaggable.rb in detour-0.0.3 vs lib/detour/flaggable.rb in detour-0.0.5
- old
+ new
@@ -10,21 +10,11 @@
end
# Returns whether or not the object has access to the given feature. If given
# a block, it will call the block if the user has access to the feature.
#
- # If an exception is raised in the block, it will increment the
- # `failure_count` of the feature and raise the exception.
- #
# @example
- # # Exceptions will be tracked in the `failure_count` of :new_user_interface.
- # user.has_feature?(:new_user_interface) do
- # # ...
- # end
- #
- # @example
- # # Exceptions will *not* be tracked in the `failure_count` of :new_user_interface.
# if user.has_feature?(:new_user_interface)
# # ...
# end
#
# @param [Symbol] feature_name The name of the
@@ -43,18 +33,9 @@
match = feature.match? self
if match
detour_features << feature.name.to_s
- end
- end
-
- if match && block_given?
- begin
- yield
- rescue => e
- feature.increment! :failure_count
- raise e
end
end
match
end