Class: Ably::Models::Stats::IntegerDefaultZero Private

Inherits:
Object
  • Object
show all
Defined in:
lib/submodules/ably-ruby/lib/ably/models/stats_types.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

IntegerDefaultZero will always return an Integer object and will default to value 0 unless truthy

Class Method Summary collapse

Class Method Details

.new(value) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



56
57
58
# File 'lib/submodules/ably-ruby/lib/ably/models/stats_types.rb', line 56

def self.new(value)
  (value && value.to_i) || 0
end