Class: File::Stat
- Defined in:
- opal/stdlib/deno/file.rb,
opal/stdlib/nodejs/file.rb
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.
302 303 304
# File 'opal/stdlib/deno/file.rb', line 302 def initialize(path) @path = path end
Instance Method Details
#directory? ⇒ Boolean
Returns:
- (Boolean )
310 311 312
# File 'opal/stdlib/deno/file.rb', line 310 def directory? `return executeIOAction(function(){return Deno.statSync(#{@path}).isDirectory})` end
#executable? ⇒ Boolean
Returns:
- (Boolean )
336 337 338 339
# File 'opal/stdlib/deno/file.rb', line 336 def executable? # accessible only over unstable API false end
#file? ⇒ Boolean
Returns:
- (Boolean )
306 307 308
# File 'opal/stdlib/deno/file.rb', line 306 def file? `return executeIOAction(function(){return Deno.statSync(#{@path}).isFile})` end
#mtime ⇒ Object
314 315 316
# File 'opal/stdlib/deno/file.rb', line 314 def mtime `return executeIOAction(function(){return Deno.statSync(#{@path}).mtime})` end