Class: Jam_Func::Run
Overview
# ================================================================ # ================== Run (private) =============================== # ================================================================
Constant Summary
Constants included from Helpers
Instance Attribute Summary collapse
-
#err ⇒ Object
readonly
Returns the value of attribute err.
-
#err_name ⇒ Object
readonly
Returns the value of attribute err_name.
Instance Method Summary collapse
-
#initialize(jam, parent_run, data, arr) ⇒ Run
constructor
A new instance of Run.
-
#run ⇒ Object
initialize.
Methods included from Helpers
Constructor Details
#initialize(jam, parent_run, data, arr) ⇒ Run
Returns a new instance of Run.
226 227 228 229 230 231 232 233 234 235 236 237 238 239 |
# File 'lib/Jam_Func.rb', line 226 def initialize(jam, parent_run, data, arr) @jam = jam @parent_run = parent_run @data = data @tasks = nil @proc_list = arr.map { |n| n.kind_of?(String) ? canon_name(n) : n } end |
Instance Attribute Details
#err ⇒ Object (readonly)
Returns the value of attribute err.
224 225 226 |
# File 'lib/Jam_Func.rb', line 224 def err @err end |
#err_name ⇒ Object (readonly)
Returns the value of attribute err_name.
224 225 226 |
# File 'lib/Jam_Func.rb', line 224 def err_name @err_name end |
Instance Method Details
#run ⇒ Object
initialize
241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 |
# File 'lib/Jam_Func.rb', line 241 def run raise("Already running.") if @tasks @tasks = [] @proc_list.each { |var| if var.kind_of? String @tasks.push(@jam.entire_list_for(var)); else @tasks.push var end } @tasks = @tasks.flatten jam = Jam_Func::Jam.new(@data) @tasks.detect { |func| is_fine = catch :jam_error do args = [jam.data, jam.last, jam].slice(0, func.arity) jam._last func.call *args true end !is_fine } jam end |