Class: DatashiftJourney::Configuration
- Inherits:
-
Object
- Object
- DatashiftJourney::Configuration
- Defined in:
- lib/datashift_journey/configuration.rb
Class Attribute Summary collapse
-
.configuration ⇒ Object
writeonly
Sets the attribute configuration.
Instance Attribute Summary collapse
-
#add_state_jumper_toolbar ⇒ Object
In development, you can add a state jumper toolbar, for jumping straight to any state.
- #backto_start_url ⇒ Object
-
#forms_module_name ⇒ String<#call>
The module(s) under which to find Forms Form factory will look for a Form class related to a state called.
-
#layout ⇒ Object
Returns the value of attribute layout.
-
#null_form_list ⇒ Array<#call>
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.
-
#partial_location ⇒ Object
The location of the View partials, for rendering.
-
#state_jumper_states ⇒ Object
Add required details of states to jump to (see StateJumperEntry) to this ARRAY.
-
#use_null_form_when_no_form ⇒ Boolean<#call>
Always use a NullForm when no designated Form for a page.
Class Method Summary collapse
-
.call ⇒ DatashiftJourney::Configuration
Current configuration.
-
.configure {|call| ... } ⇒ Object
Modify current DatashiftJourney configuration “‘ DatashiftJourney::Configuration.configure do |config| config.html_only = false end “`.
- .reset ⇒ Object
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
62 63 64 65 66 67 68 69 70 71 72 73 |
# 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 |
Class Attribute Details
.configuration=(value) ⇒ Object (writeonly)
Sets the attribute configuration
90 91 92 |
# File 'lib/datashift_journey/configuration.rb', line 90 def configuration=(value) @configuration = value end |
Instance Attribute Details
#add_state_jumper_toolbar ⇒ Object
In development, you can add a state jumper toolbar, for jumping straight to any state
49 50 51 |
# File 'lib/datashift_journey/configuration.rb', line 49 def @add_state_jumper_toolbar end |
#backto_start_url ⇒ Object
75 76 77 |
# File 'lib/datashift_journey/configuration.rb', line 75 def backto_start_url @backto_start_url ||= Rails.application.routes.url_helpers.root_path end |
#forms_module_name ⇒ String<#call>
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"
23 24 25 |
# File 'lib/datashift_journey/configuration.rb', line 23 def forms_module_name @forms_module_name end |
#layout ⇒ Object
Returns the value of attribute layout.
45 46 47 |
# File 'lib/datashift_journey/configuration.rb', line 45 def layout @layout end |
#null_form_list ⇒ Array<#call>
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
31 32 33 |
# File 'lib/datashift_journey/configuration.rb', line 31 def null_form_list @null_form_list end |
#partial_location ⇒ Object
The location of the View partials, for rendering
default is empty, for views stored directly in app/views
43 44 45 |
# File 'lib/datashift_journey/configuration.rb', line 43 def partial_location @partial_location end |
#state_jumper_states ⇒ Object
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
60 61 62 |
# File 'lib/datashift_journey/configuration.rb', line 60 def state_jumper_states @state_jumper_states end |
#use_null_form_when_no_form ⇒ Boolean<#call>
Always use a NullForm when no designated Form for a page
37 38 39 |
# File 'lib/datashift_journey/configuration.rb', line 37 def use_null_form_when_no_form @use_null_form_when_no_form end |
Class Method Details
.call ⇒ DatashiftJourney::Configuration
Returns current configuration.
80 81 82 |
# File 'lib/datashift_journey/configuration.rb', line 80 def self.call @configuration ||= DatashiftJourney::Configuration.new end |
.configure {|call| ... } ⇒ Object
Modify current DatashiftJourney configuration “‘
DatashiftJourney::Configuration.configure do |config|
config.html_only = false
end
“‘
99 100 101 |
# File 'lib/datashift_journey/configuration.rb', line 99 def self.configure yield call end |
.reset ⇒ Object
84 85 86 |
# File 'lib/datashift_journey/configuration.rb', line 84 def self.reset @configuration = DatashiftJourney::Configuration.new end |