Class: File::Stat
Instance Method Summary collapse
- #directory? ⇒ Boolean
- #executable? ⇒ Boolean
- #file? ⇒ Boolean
-
#initialize(path) ⇒ Stat
constructor
A new instance of Stat.
- #mtime ⇒ Object
- #readable? ⇒ Boolean
- #writable? ⇒ Boolean
Constructor Details
#initialize(path) ⇒ Stat
Returns a new instance of Stat.
312 313 314 |
# File 'opal/stdlib/nodejs/file.rb', line 312 def initialize(path) @path = path end |
Instance Method Details
#directory? ⇒ Boolean
320 321 322 |
# File 'opal/stdlib/nodejs/file.rb', line 320 def directory? `return executeIOAction(function(){return __fs__.statSync(#{@path}).isDirectory()})` end |
#executable? ⇒ Boolean
336 337 338 |
# File 'opal/stdlib/nodejs/file.rb', line 336 def executable? `return executeIOAction(function(){return __fs__.accessSync(#{@path}, __fs__.constants.X_OK)})` end |
#file? ⇒ Boolean
316 317 318 |
# File 'opal/stdlib/nodejs/file.rb', line 316 def file? `return executeIOAction(function(){return __fs__.statSync(#{@path}).isFile()})` end |
#mtime ⇒ Object
324 325 326 |
# File 'opal/stdlib/nodejs/file.rb', line 324 def mtime `return executeIOAction(function(){return __fs__.statSync(#{@path}).mtime})` end |
#readable? ⇒ Boolean
328 329 330 |
# File 'opal/stdlib/nodejs/file.rb', line 328 def readable? `return executeIOAction(function(){return __fs__.accessSync(#{@path}, __fs__.constants.R_OK)})` end |
#writable? ⇒ Boolean
332 333 334 |
# File 'opal/stdlib/nodejs/file.rb', line 332 def writable? `return executeIOAction(function(){return __fs__.accessSync(#{@path}, __fs__.constants.W_OK)})` end |