Class: Wukong::Store::Base
Direct Known Subclasses
Instance Method Summary collapse
-
#each_as(klass, &block) ⇒ Object
Iterate through each object casting it as a new object of klass.
-
#initialize(options = {}) ⇒ Base
constructor
A new instance of Base.
- #log_line ⇒ Object
Constructor Details
Instance Method Details
#each_as(klass, &block) ⇒ Object
Iterate through each object casting it as a new object of klass.
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/wukong/store/base.rb', line 9 def each_as klass, &block self.each do |*args| begin item = klass.new *args[1..-1] rescue StandardError => e Log.info [args, e.to_s, self].join("\t") raise e end yield item end end |
#log_line ⇒ Object
21 22 23 |
# File 'lib/wukong/store/base.rb', line 21 def log_line nil end |