Class: Gamefic::Script::File

Inherits:
Base
  • Object
show all
Defined in:
lib/gamefic/script/file.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_pathObject (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

#pathObject (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

#readObject



9
10
11
# File 'lib/gamefic/script/file.rb', line 9

def read
  File.read(@absolute_path)
end