Class: FileSandbox::SandboxFile
- Inherits:
-
Object
- Object
- FileSandbox::SandboxFile
- Defined in:
- lib/file_sandbox.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #content ⇒ Object (also: #contents)
- #exist? ⇒ Boolean (also: #exists?)
-
#initialize(name) ⇒ SandboxFile
constructor
A new instance of SandboxFile.
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
#name ⇒ Object (readonly)
Returns the value of attribute name.
98 99 100 |
# File 'lib/file_sandbox.rb', line 98 def name @name end |
Instance Method Details
#content ⇒ Object 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?
104 105 106 |
# File 'lib/file_sandbox.rb', line 104 def exist? File.exist? name end |