Class: FileSandbox::SandboxFile

Inherits:
Object
  • Object
show all
Defined in:
lib/file_sandbox.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ SandboxFile

Returns a new instance of SandboxFile.



100
101
102
# File 'lib/file_sandbox.rb', line 100

def initialize(name)
  @name = name
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



98
99
100
# File 'lib/file_sandbox.rb', line 98

def name
  @name
end

Instance Method Details

#contentObject Also known as: contents



110
111
112
# File 'lib/file_sandbox.rb', line 110

def content
  File.read name
end

#exist?Boolean Also known as: exists?

Returns:

  • (Boolean)


104
105
106
# File 'lib/file_sandbox.rb', line 104

def exist?
  File.exist? name
end