Class: Gamefic::Sdk::PlotConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/gamefic-sdk/plot_config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#authorObject (readonly)

Returns the value of attribute author.



6
7
8
# File 'lib/gamefic-sdk/plot_config.rb', line 6

def author
  @author
end

#media_pathsObject (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_pathsObject (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

#titleObject (readonly)

Returns the value of attribute title.



6
7
8
# File 'lib/gamefic-sdk/plot_config.rb', line 6

def title
  @title
end