Module: Onboardable::ClassMethods
- Defined in:
- lib/onboardable.rb
Overview
Class methods for managing the onboarding process, added to the class that includes the Onboardable module.
Instance Attribute Summary collapse
-
#list_builder ⇒ List::Builder
The ListBuilder for configuring onboarding steps.
Instance Method Summary collapse
-
#onboarding(current_step_name = nil) ⇒ List::Base
Builds the onboarding list and optionally sets the current step.
-
#onboarding=(options = {}) {|List::Builder| ... } ⇒ Step
(also: #has_onboarding)
Configures onboarding steps via a ListBuilder with a provided block.
Instance Attribute Details
#list_builder ⇒ List::Builder
Returns The ListBuilder for configuring onboarding steps.
25 26 27 |
# File 'lib/onboardable.rb', line 25 def list_builder @list_builder end |
Instance Method Details
#onboarding(current_step_name = nil) ⇒ List::Base
Builds the onboarding list and optionally sets the current step.
42 43 44 |
# File 'lib/onboardable.rb', line 42 def onboarding(current_step_name = nil) list_builder.build(current_step_name) end |
#onboarding=(options = {}) {|List::Builder| ... } ⇒ Step Also known as: has_onboarding
Configures onboarding steps via a ListBuilder with a provided block.
32 33 34 35 |
# File 'lib/onboardable.rb', line 32 def onboarding=( = {}, &block) self.list_builder = List::Builder.new() list_builder.instance_eval(&block) end |