Class: Gamefic::Script::Base
- Inherits:
-
Object
- Object
- Gamefic::Script::Base
- Defined in:
- lib/gamefic/script/base.rb
Instance Method Summary collapse
-
#==(other) ⇒ Boolean
Script objects are equal if their relative paths are the same.
-
#absolute_path ⇒ String
Get the absolute path of the script’s original file, or its URL for sources that are not file-based.
-
#initialize ⇒ Base
constructor
A new instance of Base.
-
#path ⇒ String
Get the script’s path.
-
#read ⇒ String
Get the script’s text.
Constructor Details
#initialize ⇒ 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
Script objects are equal if their relative paths are the same. Note that they are still considered equal if their absolute paths are different, or even if they come from different types of sources.
33 34 35 |
# File 'lib/gamefic/script/base.rb', line 33 def==(other) path == other.path end |
#absolute_path ⇒ String
Get the absolute path of the script’s original file, or its URL for sources that are not file-based.
24 25 26 |
# File 'lib/gamefic/script/base.rb', line 24 def absolute_path raise "#absolute_path must be defined in subclasses" end |
#path ⇒ String
Get the script’s path.
17 18 19 |
# File 'lib/gamefic/script/base.rb', line 17 def path raise "#path must be defined in subclasses" end |
#read ⇒ String
Get the script’s text. The text must be source code suitable for evaluation via Plot#stage.
11 12 13 |
# File 'lib/gamefic/script/base.rb', line 11 def read raise "#read must be defined in subclasses" end |