Methods

Files

Class/Module Index [+]

Quicksearch

God::Conditions::FileMtime

Attributes

max_age[RW]
path[RW]

Public Class Methods

new() click to toggle source
# File lib/god/conditions/file_mtime.rb, line 7
def initialize
  super
  self.path = nil
  self.max_age = nil
end

Public Instance Methods

test() click to toggle source
# File lib/god/conditions/file_mtime.rb, line 20
def test
  (Time.now - File.mtime(self.path)) > self.max_age
end
valid?() click to toggle source
# File lib/god/conditions/file_mtime.rb, line 13
def valid?
  valid = true
  valid &= complain("Attribute 'path' must be specified", self) if self.path.nil?
  valid &= complain("Attribute 'max_age' must be specified", self) if self.max_age.nil?
  valid
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.