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.
311 312 313 |
# File 'opal/stdlib/nodejs/file.rb', line 311 def initialize(path) @path = path end |
Instance Method Details
#directory? ⇒ Boolean
319 320 321 |
# File 'opal/stdlib/nodejs/file.rb', line 319 def directory? `return executeIOAction(function(){return __fs__.statSync(#{@path}).isDirectory()})` end |
#executable? ⇒ Boolean
335 336 337 |
# File 'opal/stdlib/nodejs/file.rb', line 335 def executable? `return executeIOAction(function(){return __fs__.accessSync(#{@path}, __fs__.constants.X_OK)})` end |
#file? ⇒ Boolean
315 316 317 |
# File 'opal/stdlib/nodejs/file.rb', line 315 def file? `return executeIOAction(function(){return __fs__.statSync(#{@path}).isFile()})` end |
#mtime ⇒ Object
323 324 325 |
# File 'opal/stdlib/nodejs/file.rb', line 323 def mtime `return executeIOAction(function(){return __fs__.statSync(#{@path}).mtime})` end |
#readable? ⇒ Boolean
327 328 329 |
# File 'opal/stdlib/nodejs/file.rb', line 327 def readable? `return executeIOAction(function(){return __fs__.accessSync(#{@path}, __fs__.constants.R_OK)})` end |
#writable? ⇒ Boolean
331 332 333 |
# File 'opal/stdlib/nodejs/file.rb', line 331 def writable? `return executeIOAction(function(){return __fs__.accessSync(#{@path}, __fs__.constants.W_OK)})` end |