class NoWhen::Model::Tag
Public Class Methods
find(query={})
click to toggle source
# File lib/nowhen/model/tag.rb, line 12 def self.find(query={}) {:order => [:created_at.asc]}.each do |k,v| query[k] = v unless query.include? k end self.all query end
Public Instance Methods
logs(minute=5)
click to toggle source
# File lib/nowhen/model/tag.rb, line 19 def logs(minute=5) rational = Rational(1, 24*60/minute) Log.find :created_at => (self.created_at-rational)..(self.created_at+rational) end
to_s()
click to toggle source
# File lib/nowhen/model/tag.rb, line 24 def to_s "[#{self.what}]\t#{self.created_at.strftime '(%m/%d %a %H:%M:%S)'}" end