moved user and log class to models, verify prints logs
[ruby_srp.git] / example / models / log.rb
1 require 'yaml'
2
3 class Log
4
5   def self.current
6     @current ||= Log.new
7   end
8
9   def self.log(*args)
10     self.current.log(*args)
11   end
12
13   def self.clear
14     @current = nil
15   end
16
17   attr_accessor :actions
18
19   def initialize
20     @actions = []
21   end
22
23   def log(action, params)
24     @actions << {action => params.dup}
25   end
26
27   def pretty
28     @actions.to_yaml
29   end
30
31 end