Sha256: 4992c01191b33155ac052a1da64982c29a7946477e37b503d6dfee18c33ab086
Contents?: true
Size: 1.5 KB
Versions: 1
Compression:
Stored size: 1.5 KB
Contents
# lib/stair_master/concerns/getters.rb ## ## ## module StairMaster module Concerns module Getters extend ActiveSupport::Concern def get_step_index_by_name(step_name) available_steps.find_index step_name end def get_step_name_by_index(step_index) available_steps[step_index] end def get_step_by_index(step_index) get_step_by_name available_steps[step_index] end def get_step_by_name(step_name) workflow_map.steps[step_name] end def get_next_step_index on_last_step? ? nil : find_next_step_index end def get_previous_step_index(step_index=nil) on_first_step? ? nil : find_previous_step_index end private # ------------------------------------------- def find_previous_step_index(step_index=nil) previous_index = step_index.nil? ? current_step_index.pred : step_index.pred step = get_step_by_index previous_index if step.nil? nil elsif step.skip?(self) find_previous_step_index(previous_index) else previous_index end end def find_next_step_index(step_index=nil) next_index = step_index.nil? ? current_step_index.next : step_index.next step = get_step_by_index next_index if step.nil? nil elsif step.skip?(self) find_next_step_index(next_index) else next_index end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
stair_master-0.0.1 | lib/stair_master/concerns/getters.rb |