Class: GraphStarter::Configuration
- Inherits:
-
Object
- Object
- GraphStarter::Configuration
- Defined in:
- lib/graph_starter/configuration.rb
Instance Attribute Summary collapse
-
#editable_properties ⇒ Object
Returns the value of attribute editable_properties.
-
#icon_classes ⇒ Object
Returns the value of attribute icon_classes.
-
#menu_models ⇒ Object
Returns the value of attribute menu_models.
-
#scope_filters ⇒ Object
Returns the value of attribute scope_filters.
- #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 10 11 |
# File 'lib/graph_starter/configuration.rb', line 7 def initialize @icon_classes = {} @scope_filters = {} @editable_properties = {} end |
Instance Attribute Details
#editable_properties ⇒ Object
Returns the value of attribute editable_properties.
5 6 7 |
# File 'lib/graph_starter/configuration.rb', line 5 def editable_properties @editable_properties end |
#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 |
#scope_filters ⇒ Object
Returns the value of attribute scope_filters.
5 6 7 |
# File 'lib/graph_starter/configuration.rb', line 5 def scope_filters @scope_filters end |
#user_class ⇒ Object
13 14 15 |
# File 'lib/graph_starter/configuration.rb', line 13 def user_class @user_class || (:User if defined?(::User)) end |
Instance Method Details
#validation_errors ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/graph_starter/configuration.rb', line 17 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 if !@editable_properties.is_a?(Hash) errors[:editable_properties] = 'should be a Hash' end if !@scope_filters.is_a?(Hash) errors[:scope_filters] = 'should be a Hash' end end end |