lib/ip_api/fields.rb
# Calculates an unique numeric value for a collection of fields.
Calculates an unique numeric value for a collection of fields.
Calculates an unique numeric value for a collection of fields .
def numeric_fields(*args)
      result = args.flatten.inject(0) do |memo, value|
        memo + field_to_numeric(value)
      end
      result.zero? ? nil : result
    end
def numeric_fields ( * args ) result = args . flatten . inject ( 0 ) do | memo , value | memo + field_to_numeric ( value ) end result . zero? ? nil : result end
Calculates an unique numeric value for a collection of fields.
Calculates an unique numeric value for a collection of fields .
args