Class: Gamefic::Script::File
Instance Attribute Summary collapse
-
#absolute_path ⇒ Object
readonly
Returns the value of attribute absolute_path.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
-
#initialize(filename, path) ⇒ File
constructor
A new instance of File.
- #read ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(filename, path) ⇒ File
Returns a new instance of File.
5 6 7 8 |
# File 'lib/gamefic/script/file.rb', line 5 def initialize filename, path @absolute_path = filename.gsub(/\/+/, '/') @path = path end |
Instance Attribute Details
#absolute_path ⇒ Object (readonly)
Returns the value of attribute absolute_path.
4 5 6 |
# File 'lib/gamefic/script/file.rb', line 4 def absolute_path @absolute_path end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
4 5 6 |
# File 'lib/gamefic/script/file.rb', line 4 def path @path end |
Instance Method Details
#read ⇒ Object
9 10 11 |
# File 'lib/gamefic/script/file.rb', line 9 def read File.read(@absolute_path) end |