lib/bouncefetch/application/statistics.rb
# accessing or modifing a registered statistic key by calling it on the statistic handler
#
# ### Examples
#     @stats.my_added_key    # returns the current value
#     @stats.my_added_key 3  # will increase the value by 3 and return the result
#     @stats.my_added_key +3 # the same
#     @stats.my_added_key -3 # will decrease the value by 3 and return the result
#
# @param [Symbol] key statistic key name
# @param [Integer] modify_value positive or negative number to in/decrease the value (if not passed or nil no changes will be made)
# @return [Integer] current value (if changes are made this is the result of it)
accessing or modifing a registered statistic key by calling it on the statistic handler
Examples
@stats.my_added_key    # returns the current value
@stats.my_added_key 3  # will increase the value by 3 and return the result
@stats.my_added_key +3 # the same
@stats.my_added_key -3 # will decrease the value by 3 and return the result
accessing or modifing a registered statistic key by calling it on the statistic handler Examples @stats . my_added_key # returns the current value @stats . my_added_key 3 # will increase the value by 3 and return the result @stats . my_added_key + 3 # the same @stats . my_added_key - 3 # will decrease the value by 3 and return the result
def method_missing key, *args, &block
        if @storage.has_key?(key.to_sym)
          @storage[key.to_sym][:value] += args[0] unless args[0].blank?
          @storage[key.to_sym][:value]
        end
      end
def method_missing key , * args , & block if @storage . has_key? ( key . to_sym ) @storage [ key . to_sym ] [ :value ] += args [ 0 ] unless args [ 0 ] . blank? @storage [ key . to_sym ] [ :value ] end end
accessing or modifing a registered statistic key by calling it on the statistic handler
 Examples
@stats.my_added_key    # returns the current value
@stats.my_added_key 3  # will increase the value by 3 and return the result
@stats.my_added_key +3 # the same
@stats.my_added_key -3 # will decrease the value by 3 and return the result
accessing or modifing a registered statistic key by calling it on the statistic handler Examples @stats . my_added_key # returns the current value @stats . my_added_key 3 # will increase the value by 3 and return the result @stats . my_added_key + 3 # the same @stats . my_added_key - 3 # will decrease the value by 3 and return the result
current value (if changes are made this is the result of it)
current value ( if changes are made this is the result of it )
Integer
key
<not_specific>
args
<not_specific>
block
<not_specific>
<not_specific>
modify_value positive or negative number to in/decrease the value (if not passed or nil no changes will be made)
modify_value positive or negative number to in / decrease the value ( if not passed or nil no changes will be made )