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-3.5.4 lib/intercom/traits/incrementable_attributes.rb
intercom-3.5.3 lib/intercom/traits/incrementable_attributes.rb
intercom-3.5.2 lib/intercom/traits/incrementable_attributes.rb
cogniteev-intercom-2.5.4 lib/intercom/traits/incrementable_attributes.rb
intercom-3.5.1 lib/intercom/traits/incrementable_attributes.rb
intercom-3.4.0 lib/intercom/traits/incrementable_attributes.rb
intercom-3.3.0 lib/intercom/traits/incrementable_attributes.rb
intercom-3.2.0 lib/intercom/traits/incrementable_attributes.rb
intercom-3.1.0 lib/intercom/traits/incrementable_attributes.rb
intercom-3.0.6 lib/intercom/traits/incrementable_attributes.rb
intercom-3.0.5 lib/intercom/traits/incrementable_attributes.rb
intercom-3.0.4 lib/intercom/traits/incrementable_attributes.rb
intercom-3.0.3 lib/intercom/traits/incrementable_attributes.rb
intercom-3.0.2 lib/intercom/traits/incrementable_attributes.rb
intercom-3.0.0 lib/intercom/traits/incrementable_attributes.rb
intercom-3.0.0b1 lib/intercom/traits/incrementable_attributes.rb
intercom-2.5.4 lib/intercom/traits/incrementable_attributes.rb
intercom-2.4.4 lib/intercom/traits/incrementable_attributes.rb
intercom-2.4.3 lib/intercom/traits/incrementable_attributes.rb
intercom-2.4.2 lib/intercom/traits/incrementable_attributes.rb