Class: Needy::IChat
- Inherits:
-
Object
- Object
- Needy::IChat
- Defined in:
- lib/needy.rb
Instance Attribute Summary collapse
-
#dir ⇒ Object
Returns the value of attribute dir.
-
#target ⇒ Object
Returns the value of attribute target.
Instance Method Summary collapse
- #chatter(abbrev, name) ⇒ Object
-
#initialize(dir, target) ⇒ IChat
constructor
A new instance of IChat.
- #when(name) ⇒ Object
Constructor Details
#initialize(dir, target) ⇒ IChat
Returns a new instance of IChat.
107 108 109 110 |
# File 'lib/needy.rb', line 107 def initialize dir, target self.dir = dir self.target = target end |
Instance Attribute Details
#dir ⇒ Object
Returns the value of attribute dir.
105 106 107 |
# File 'lib/needy.rb', line 105 def dir @dir end |
#target ⇒ Object
Returns the value of attribute target.
105 106 107 |
# File 'lib/needy.rb', line 105 def target @target end |
Instance Method Details
#chatter(abbrev, name) ⇒ Object
123 124 125 |
# File 'lib/needy.rb', line 123 def chatter abbrev, name target.thr { target.set abbrev, self.when(name) } end |
#when(name) ⇒ Object
112 113 114 115 116 117 118 119 120 121 |
# File 'lib/needy.rb', line 112 def when name Dir["#{dir}/*"].sort.reverse.each do |dir| Dir["#{dir}/*.ichat"].each do |path| if path =~ /\/#{name} on / return File.mtime(path) end end end return Time.at(0) end |