Class: Project::Unpacker::Total

Inherits:
Base
  • Object
show all
Defined in:
lib/ossert/repositories.rb

Instance Method Summary collapse

Methods inherited from Base

#coerce_value, #initialize, #stored_data

Constructor Details

This class inherits a constructor from Project::Unpacker::Base

Instance Method Details

#new_stats_objectObject



102
103
104
# File 'lib/ossert/repositories.rb', line 102

def new_stats_object
  Kernel.const_get("Ossert::Stats::#{@stats_type.capitalize}Total").new
end

#processObject



106
107
108
109
110
111
112
# File 'lib/ossert/repositories.rb', line 106

def process
  MultiJson.load(
    stored_data
  ).each_with_object(new_stats_object) do |(metric, value), stats_object|
    stats_object.send "#{metric}=", coerce_value(value)
  end
end

#sectionObject



98
99
100
# File 'lib/ossert/repositories.rb', line 98

def section
  :total
end