Class: Cotta::ContentStat
- Inherits:
-
Object
- Object
- Cotta::ContentStat
- Defined in:
- lib/cotta/impl/in_memory_system.rb
Instance Attribute Summary collapse
-
#mtime ⇒ Object
readonly
Returns the value of attribute mtime.
Instance Method Summary collapse
- #<=>(stat) ⇒ Object
- #directory? ⇒ Boolean
- #file? ⇒ Boolean
-
#initialize(content) ⇒ ContentStat
constructor
A new instance of ContentStat.
- #mode ⇒ Object
- #size ⇒ Object
- #touch ⇒ Object
- #writable? ⇒ Boolean
Constructor Details
#initialize(content) ⇒ ContentStat
Returns a new instance of ContentStat.
262 263 264 265 |
# File 'lib/cotta/impl/in_memory_system.rb', line 262 def initialize(content) @content = content @mtime = Time.new end |
Instance Attribute Details
#mtime ⇒ Object (readonly)
Returns the value of attribute mtime.
260 261 262 |
# File 'lib/cotta/impl/in_memory_system.rb', line 260 def mtime @mtime end |
Instance Method Details
#<=>(stat) ⇒ Object
291 292 293 |
# File 'lib/cotta/impl/in_memory_system.rb', line 291 def <=> stat mtime <=> stat.mtime end |
#directory? ⇒ Boolean
279 280 281 |
# File 'lib/cotta/impl/in_memory_system.rb', line 279 def directory? @content.directory? end |
#file? ⇒ Boolean
275 276 277 |
# File 'lib/cotta/impl/in_memory_system.rb', line 275 def file? @content.file? end |
#mode ⇒ Object
267 268 269 |
# File 'lib/cotta/impl/in_memory_system.rb', line 267 def mode '10777' end |
#size ⇒ Object
271 272 273 |
# File 'lib/cotta/impl/in_memory_system.rb', line 271 def size @content.size end |
#touch ⇒ Object
283 284 285 |
# File 'lib/cotta/impl/in_memory_system.rb', line 283 def touch @mtime = Time.new end |
#writable? ⇒ Boolean
287 288 289 |
# File 'lib/cotta/impl/in_memory_system.rb', line 287 def writable? true end |