Class: Gamefic::Script::Base

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

Direct Known Subclasses

File, Text

Instance Method Summary collapse

Constructor Details

#initializeBase

Returns a new instance of Base.



4
5
6
# File 'lib/gamefic/script/base.rb', line 4

def initialize
  raise "#initialize must be defined in subclasses"
end

Instance Method Details

#==(other) ⇒ Boolean

Parameters:

Returns:

  • (Boolean)


28
29
30
# File 'lib/gamefic/script/base.rb', line 28

def==(other)
  path == other.path
end

#absolute_pathString

Get the absolute path of the script’s original file

Returns:



23
24
25
# File 'lib/gamefic/script/base.rb', line 23

def absolute_path
  raise "#absolute_path must be defined in subclasses"
end

#pathString

Get the script’s path

Returns:



17
18
19
# File 'lib/gamefic/script/base.rb', line 17

def path
  raise "#path must be defined in subclasses"
end

#readString

Get the script’s text. The text must be source code suitable for evaluation via Plot#stage.

Returns:



11
12
13
# File 'lib/gamefic/script/base.rb', line 11

def read
  raise "#read must be defined in subclasses"
end