Class: Quick::FS::ROCodeFile
Instance Attribute Summary collapse
-
#ctime ⇒ Object
Returns the value of attribute ctime.
-
#mtime ⇒ Object
Returns the value of attribute mtime.
-
#source ⇒ Object
Returns the value of attribute source.
Instance Method Summary collapse
-
#initialize(source) ⇒ ROCodeFile
constructor
A new instance of ROCodeFile.
- #read_file(path) ⇒ Object
- #size(path) ⇒ Object
- #times(path) ⇒ Object
Constructor Details
#initialize(source) ⇒ ROCodeFile
Returns a new instance of ROCodeFile.
52 53 54 |
# File 'lib/quick/fs.rb', line 52 def initialize(source) @source = source end |
Instance Attribute Details
#ctime ⇒ Object
Returns the value of attribute ctime.
50 51 52 |
# File 'lib/quick/fs.rb', line 50 def ctime @ctime end |
#mtime ⇒ Object
Returns the value of attribute mtime.
50 51 52 |
# File 'lib/quick/fs.rb', line 50 def mtime @mtime end |
#source ⇒ Object
Returns the value of attribute source.
50 51 52 |
# File 'lib/quick/fs.rb', line 50 def source @source end |
Instance Method Details
#read_file(path) ⇒ Object
65 66 67 68 |
# File 'lib/quick/fs.rb', line 65 def read_file(path) @atime = Time.now @source end |
#size(path) ⇒ Object
61 62 63 |
# File 'lib/quick/fs.rb', line 61 def size(path) @source.bytesize end |
#times(path) ⇒ Object
56 57 58 59 |
# File 'lib/quick/fs.rb', line 56 def times(path) now = Time.now [@atime ||= now, @mtime ||= now, @ctime ||= now] end |