Class: CodeReaper::File
- Inherits:
-
Object
- Object
- CodeReaper::File
- Defined in:
- lib/code_reaper/file.rb
Instance Attribute Summary collapse
-
#file ⇒ Object
readonly
Returns the value of attribute file.
-
#filename ⇒ Object
readonly
Returns the value of attribute filename.
Instance Method Summary collapse
-
#initialize(filename, input = ::File) ⇒ File
constructor
A new instance of File.
- #strip(regex) ⇒ Object
Constructor Details
#initialize(filename, input = ::File) ⇒ File
Returns a new instance of File.
5 6 7 8 9 10 11 12 |
# File 'lib/code_reaper/file.rb', line 5 def initialize(filename, input = ::File) unless input.file?(filename) raise InvalidFile, filename end @filename = filename @file = input.read filename end |
Instance Attribute Details
#file ⇒ Object (readonly)
Returns the value of attribute file.
3 4 5 |
# File 'lib/code_reaper/file.rb', line 3 def file @file end |
#filename ⇒ Object (readonly)
Returns the value of attribute filename.
3 4 5 |
# File 'lib/code_reaper/file.rb', line 3 def filename @filename end |