Module: GasStats

Defined in:
lib/gas_stats.rb,
lib/gas_stats/version.rb

Constant Summary collapse

VERSION =
'0.1.0'

Class Method Summary collapse

Class Method Details

.addObject



23
24
25
# File 'lib/gas_stats.rb', line 23

def self.add
  update_key 'add'
end

.deleteObject



27
28
29
# File 'lib/gas_stats.rb', line 27

def self.delete
  update_key 'delete'
end

.importObject



31
32
33
# File 'lib/gas_stats.rb', line 31

def self.import
  update_key 'import'
end

.listObject



35
36
37
# File 'lib/gas_stats.rb', line 35

def self.list
  update_key 'list'
end

.showObject



39
40
41
# File 'lib/gas_stats.rb', line 39

def self.show
  update_key 'show'
end

.statsObject



12
13
14
15
16
17
18
19
20
21
# File 'lib/gas_stats.rb', line 12

def self.stats
  if @config
    puts 'Gas statistics:'
    [:add, :delete, :import, :list, :show, :use].each do |key|
      puts "   #{key.to_s}: #{(@config[key.to_s] ? @config[key.to_s] : 0)}"
    end
  else
    puts 'No statistics yet'
  end
end

.useObject



43
44
45
# File 'lib/gas_stats.rb', line 43

def self.use
  update_key 'use'
end