Class: Gitlab::CycleAnalytics::Summary::Value::Numeric

Inherits:
Gitlab::CycleAnalytics::Summary::Value show all
Defined in:
lib/gitlab/cycle_analytics/summary/value.rb

Direct Known Subclasses

PrettyNumeric

Instance Attribute Summary

Attributes inherited from Gitlab::CycleAnalytics::Summary::Value

#value

Instance Method Summary collapse

Methods inherited from Gitlab::CycleAnalytics::Summary::Value

#raw_value

Constructor Details

#initialize(value) ⇒ Numeric

Returns a new instance of Numeric.


32
33
34
# File 'lib/gitlab/cycle_analytics/summary/value.rb', line 32

def initialize(value)
  @value = value
end

Instance Method Details

#to_iObject


40
41
42
# File 'lib/gitlab/cycle_analytics/summary/value.rb', line 40

def to_i
  raw_value
end

#to_sObject


36
37
38
# File 'lib/gitlab/cycle_analytics/summary/value.rb', line 36

def to_s
  value == 0 ? '0' : value.to_s
end