Sha256: 464be46c6b1e6b2de83e52b2b63eb1a7bb9de808127e627e08e47726d61469d9

Contents?: true

Size: 273 Bytes

Versions: 33

Compression:

Stored size: 273 Bytes

Contents

module Intercom
  module Traits
    module IncrementableAttributes

      def increment(key, value=1)
        existing_value = self.custom_attributes[key]
        existing_value ||= 0
        self.custom_attributes[key] = existing_value + value
      end
    end
  end
end

Version data entries

33 entries across 33 versions & 2 rubygems

Version Path
intercom-2.4.1 lib/intercom/traits/incrementable_attributes.rb
intercom-2.4.0 lib/intercom/traits/incrementable_attributes.rb
intercom-2.3.0 lib/intercom/traits/incrementable_attributes.rb
intercom-2.2.4 lib/intercom/traits/incrementable_attributes.rb
intercom-2.2.3 lib/intercom/traits/incrementable_attributes.rb
intercom-2.2.2 lib/intercom/traits/incrementable_attributes.rb
intercom-2.2.1 lib/intercom/traits/incrementable_attributes.rb
intercom-2.2.0 lib/intercom/traits/incrementable_attributes.rb
intercom-2.1.6 lib/intercom/traits/incrementable_attributes.rb
intercom-2.1.5 lib/intercom/traits/incrementable_attributes.rb
intercom-2.1.4 lib/intercom/traits/incrementable_attributes.rb
intercom-2.1.3 lib/intercom/traits/incrementable_attributes.rb
intercom-2.1.2 lib/intercom/traits/incrementable_attributes.rb