Class: TimePricing::Utils

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

Class Method Summary collapse

Class Method Details

.add_hash(a, b) ⇒ Object



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

def add_hash(a, b)
  result = {}
  a.each do |key, value|
    result[key] = a[key] + b[key]
  end
  result
end

.cost_struct(cost, plans_used = []) ⇒ Object



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

def cost_struct(cost, plans_used=[])
  {
    cost: cost,
    plans_used: plans_used
  }
end