Class: GraphStarter::Configuration
- Inherits:
-
Object
- Object
- GraphStarter::Configuration
- Defined in:
- lib/graph_starter/configuration.rb
Instance Attribute Summary collapse
-
#icon_classes ⇒ Object
Returns the value of attribute icon_classes.
-
#menu_models ⇒ Object
Returns the value of attribute menu_models.
- #user_class ⇒ Object
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #validation_errors ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
7 8 9 |
# File 'lib/graph_starter/configuration.rb', line 7 def initialize @icon_classes = {} end |
Instance Attribute Details
#icon_classes ⇒ Object
Returns the value of attribute icon_classes.
5 6 7 |
# File 'lib/graph_starter/configuration.rb', line 5 def icon_classes @icon_classes end |
#menu_models ⇒ Object
Returns the value of attribute menu_models.
5 6 7 |
# File 'lib/graph_starter/configuration.rb', line 5 def @menu_models end |
#user_class ⇒ Object
11 12 13 |
# File 'lib/graph_starter/configuration.rb', line 11 def user_class @user_class || (:User if defined?(::User)) end |
Instance Method Details
#validation_errors ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/graph_starter/configuration.rb', line 15 def validation_errors {}.tap do |errors| if !(@menu_models.respond_to?(:each) || @menu_models.nil?) errors[:menu_models] = 'should be enumerable or nil' end if !@icon_classes.is_a?(Hash) errors[:icon_classes] = 'should be a Hash' end end end |