Class: BitBroker::ManagerImpl::FileActivity
- Inherits:
-
Object
- Object
- BitBroker::ManagerImpl::FileActivity
- Defined in:
- lib/bitbroker/manager_impl.rb
Constant Summary collapse
- STATUS_REMOVED =
1 << 0
Instance Attribute Summary collapse
-
#mtime ⇒ Object
readonly
Returns the value of attribute mtime.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(path, mtime, status = 0) ⇒ FileActivity
constructor
A new instance of FileActivity.
- #removed? ⇒ Boolean
Constructor Details
#initialize(path, mtime, status = 0) ⇒ FileActivity
Returns a new instance of FileActivity.
259 260 261 262 263 |
# File 'lib/bitbroker/manager_impl.rb', line 259 def initialize(path, mtime, status = 0) @path = path @mtime = mtime @status = status end |
Instance Attribute Details
#mtime ⇒ Object (readonly)
Returns the value of attribute mtime.
257 258 259 |
# File 'lib/bitbroker/manager_impl.rb', line 257 def mtime @mtime end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
257 258 259 |
# File 'lib/bitbroker/manager_impl.rb', line 257 def path @path end |
Class Method Details
.create(path) ⇒ Object
269 270 271 |
# File 'lib/bitbroker/manager_impl.rb', line 269 def self.create(path) self.new(path, FileTest.exist?(path) ? File.mtime(path) : Time.now) end |
.remove(path) ⇒ Object
273 274 275 |
# File 'lib/bitbroker/manager_impl.rb', line 273 def self.remove(path) self.new(path, nil, STATUS_REMOVED) end |
Instance Method Details
#removed? ⇒ Boolean
265 266 267 |
# File 'lib/bitbroker/manager_impl.rb', line 265 def removed? @status & STATUS_REMOVED > 0 end |