class Aio::Module::OutputStyle::CompareJson

Public Class Methods

new() click to toggle source
Calls superclass method Aio::Module::OutputStyle::new
# File lib/modules/output/style/compare_json.rb, line 9
def initialize
        super({
                :author                      => "Elin",
                :description => "这个模块输出为json文件,用于和基准值比较。",
                :file_suffix => "js",
        })
end

Public Instance Methods

generate() click to toggle source
# File lib/modules/output/style/compare_json.rb, line 17
def generate
        file = File.new(output_file, "w+")
        device_hash = {}
        each_devices_with_useful do |device_name, useful|
                device_hash[device_name] = useful
        end
        #puts device_hash.to_json
        file.puts device_hash.to_json
end