Method: PostRunner::Activity#late_init
- Defined in:
- lib/postrunner/Activity.rb
#late_init(db) ⇒ Object
YAML::load() does not call initialize(). We don’t have all attributes stored in the YAML file, so we need to make sure these are properly set after a YAML::load().
119 120 121 122 123 124 125 126 127 128 129 130 131 |
# File 'lib/postrunner/Activity.rb', line 119 def late_init(db) @db = db @html_file = File.join(@db.cfg[:html_dir], "#{@fit_file[0..-5]}.html") @unset_variables.each do |name_without_at| # The YAML file does not yet have the instance variable cached. # Load the Activity data and extract the value to set the instance # variable. @fit_activity = load_fit_file unless @fit_activity instance_variable_set('@' + name_without_at, @fit_activity.send(name_without_at)) end end |