Class: Gamefic::Sdk::PlotConfig
- Inherits:
-
Object
- Object
- Gamefic::Sdk::PlotConfig
- Defined in:
- lib/gamefic-sdk/plot_config.rb
Instance Attribute Summary collapse
-
#author ⇒ Object
readonly
Returns the value of attribute author.
-
#media_paths ⇒ Object
readonly
Returns the value of attribute media_paths.
-
#script_paths ⇒ Object
readonly
Returns the value of attribute script_paths.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
-
#initialize(filename = nil) ⇒ PlotConfig
constructor
A new instance of PlotConfig.
Constructor Details
#initialize(filename = nil) ⇒ PlotConfig
Returns a new instance of PlotConfig.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/gamefic-sdk/plot_config.rb', line 7 def initialize filename = nil @script_paths = [] @media_paths = [] if !filename.nil? config = YAML.load_file filename base_dir = File.dirname(filename) @author = config['author'] @title = config['title'] config['script_paths'].each { |p| @script_paths.push File.absolute_path(p, base_dir) } if !config['script_paths'].nil? config['media_paths'].map! { |p| @media_paths.push File.absolute_path(p, base_dir) } if !config['media_paths'].nil? end end |
Instance Attribute Details
#author ⇒ Object (readonly)
Returns the value of attribute author.
6 7 8 |
# File 'lib/gamefic-sdk/plot_config.rb', line 6 def @author end |
#media_paths ⇒ Object (readonly)
Returns the value of attribute media_paths.
6 7 8 |
# File 'lib/gamefic-sdk/plot_config.rb', line 6 def media_paths @media_paths end |
#script_paths ⇒ Object (readonly)
Returns the value of attribute script_paths.
6 7 8 |
# File 'lib/gamefic-sdk/plot_config.rb', line 6 def script_paths @script_paths end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
6 7 8 |
# File 'lib/gamefic-sdk/plot_config.rb', line 6 def title @title end |