class Tataru::SubPlanner
returns subroutines required based on the resource
Public Class Methods
new(rrep, action)
click to toggle source
# File lib/tataru/sub_planner.rb, line 6 def initialize(rrep, action) @rrep = rrep @action = action end
Public Instance Methods
compile(*args)
click to toggle source
# File lib/tataru/sub_planner.rb, line 15 def compile(*args) SubroutineCompiler.new(@rrep, *args) end
extra_subroutines()
click to toggle source
# File lib/tataru/sub_planner.rb, line 19 def extra_subroutines return {} unless @action == :update { "#{name}_modify" => compile(:modify), "#{name}_modify_check" => compile(:modify_check), "#{name}_recreate" => compile(:recreate), "#{name}_recreate_check" => compile(:recreate_check), "#{name}_recreate_commit" => compile(:recreate_commit), "#{name}_recreate_finish" => compile(:recreate_finish) } end
name()
click to toggle source
# File lib/tataru/sub_planner.rb, line 11 def name @rrep.name end
subroutines()
click to toggle source
# File lib/tataru/sub_planner.rb, line 32 def subroutines { "#{name}_start" => compile(:"#{@action}"), "#{name}_check" => compile(:"check_#{@action}"), "#{name}_commit" => compile(:"commit_#{@action}"), "#{name}_finish" => compile(:"finish_#{@action}") }.merge(extra_subroutines) end