Class: Tabster::Configurable::Configuration
- Inherits:
-
Object
- Object
- Tabster::Configurable::Configuration
- Defined in:
- lib/tabster/configurable.rb
Overview
Holds all the parameters for the Tabster initializer and defaults that should suite most needs. It’s possible to overwrite those as well. This class is passed through the block running on the Tabster module.
Defined Under Namespace
Classes: ConfigurationError
Instance Attribute Summary collapse
-
#tab_set ⇒ Object
Returns the value of attribute tab_set.
Instance Method Summary collapse
- #configuration_path ⇒ Object
-
#draw {|@tab_set| ... } ⇒ Object
add class methods to return tabnavs self.class_eval define_method end.
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #initialize_tab_set! ⇒ Object
-
#reload ⇒ Object
Reload the tab ordering.
- #validate! ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
15 16 17 |
# File 'lib/tabster/configurable.rb', line 15 def initialize initialize_tab_set! end |
Instance Attribute Details
#tab_set ⇒ Object
Returns the value of attribute tab_set.
13 14 15 |
# File 'lib/tabster/configurable.rb', line 13 def tab_set @tab_set end |
Instance Method Details
#configuration_path ⇒ Object
42 43 44 |
# File 'lib/tabster/configurable.rb', line 42 def configuration_path "#{RAILS_ROOT}/config/initializers/tabacious.rb" end |
#draw {|@tab_set| ... } ⇒ Object
add class methods to return tabnavs self.class_eval
define_method
end
33 34 35 36 |
# File 'lib/tabster/configurable.rb', line 33 def draw yield @tab_set @tab_set end |
#initialize_tab_set! ⇒ Object
19 20 21 |
# File 'lib/tabster/configurable.rb', line 19 def initialize_tab_set! @tab_set = TabSet.new end |
#reload ⇒ Object
Reload the tab ordering
24 25 26 |
# File 'lib/tabster/configurable.rb', line 24 def reload @tab_set = tab_set.nil? ? nil : tab_set end |
#validate! ⇒ Object
38 39 40 |
# File 'lib/tabster/configurable.rb', line 38 def validate! raise ConfigurationError.new("Tab navigation needs name as a String or Symbol \n e.i. config.name = :admin") unless self.name.is_a? String or self.name.is_a? Symbol end |