Class: Stockman::Logic::Utils

Inherits:
Object
  • Object
show all
Defined in:
lib/stockman/logic/utils.rb

Class Method Summary collapse

Class Method Details

.deserialize_amount(value) ⇒ Object



12
13
14
15
16
17
18
# File 'lib/stockman/logic/utils.rb', line 12

def self.deserialize_amount(value)
  if value == 'inf'
    Float::INFINITY
  else
    value.to_i
  end
end

.serialize_amount(value) ⇒ Object



4
5
6
7
8
9
10
# File 'lib/stockman/logic/utils.rb', line 4

def self.serialize_amount(value)
  if value == Float::INFINITY
    'inf'
  else
    value.to_i
  end
end