class DatashiftJourney::Configuration

Attributes

configuration[W]
add_state_jumper_toolbar[RW]

In development, you can add a state jumper toolbar, for jumping straight to any state

backto_start_url[W]

The start page link for journey page Back links

@param [String<#call>] @return [String<#call>]

forms_module_name[RW]

The module(s) under which to find Forms Form factory will look for a Form class related to a state called

"#{mod}::#{journey_plan.state}Form"

@param [String<#call>] module name under which Forms reside @return [String<#call>]

layout[RW]
null_form_list[RW]

When no Form is required for a specific HTML page, you an specify that a NullForm is to be used by adding that state to this list

@param [Array<#call>] List of states that require only a NullForm @return [Array<#call>]

partial_location[RW]

The location of the View partials, for rendering

default is empty, for views stored directly in app/views

state_jumper_states[RW]

Add required details of states to jump to (see StateJumperEntry) to this ARRAY

So that any data required for previous states can be created, it supports passing in a Factory that creates that data for you by value. Use nil if no data required

The factory should return an instance of your DatashiftJourney.journey_plan_class

@param [ StateJumperEntry.new(:state_name, “State Name”, :state_factory), .… ]

use_null_form_when_no_form[RW]

Always use a NullForm when no designated Form for a page @param [Boolean<#call>] @return [Boolean<#call>]

Public Class Methods

call() click to toggle source

@return [DatashiftJourney::Configuration] current configuration

# File lib/datashift_journey/configuration.rb, line 80
def self.call
  @configuration ||= DatashiftJourney::Configuration.new
end
configure() { |call| ... } click to toggle source

Modify current DatashiftJourney configuration “`

DatashiftJourney::Configuration.configure do |config|
  config.html_only = false
end

“`

# File lib/datashift_journey/configuration.rb, line 99
def self.configure
  yield call
end
new() click to toggle source
# File lib/datashift_journey/configuration.rb, line 62
def initialize
  @forms_module_name = ''

  @partial_location  = ''

  @use_null_form_when_no_form = false
  @null_form_list = []

  @layout = 'application'
  @add_state_jumper_toolbar = false
  @state_jumper_states = []
end
reset() click to toggle source
# File lib/datashift_journey/configuration.rb, line 84
def self.reset
  @configuration = DatashiftJourney::Configuration.new
end

Public Instance Methods

backto_start_url() click to toggle source
# File lib/datashift_journey/configuration.rb, line 75
def backto_start_url
  @backto_start_url ||= Rails.application.routes.url_helpers.root_path
end