Class: AdminSuite::PortalDefinition
- Inherits:
-
Object
- Object
- AdminSuite::PortalDefinition
- Defined in:
- lib/admin_suite/portal_definition.rb
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
Instance Method Summary collapse
- #color(value = nil) ⇒ Object
- #dashboard(&block) ⇒ Object
- #dashboard_definition ⇒ Object
- #description(value = nil) ⇒ Object
- #icon(value = nil) ⇒ Object
-
#initialize(key) ⇒ PortalDefinition
constructor
A new instance of PortalDefinition.
- #label(value = nil) ⇒ Object
- #order(value = nil) ⇒ Object
- #to_nav_meta ⇒ Object
Constructor Details
#initialize(key) ⇒ PortalDefinition
Returns a new instance of PortalDefinition.
9 10 11 12 13 14 15 16 17 |
# File 'lib/admin_suite/portal_definition.rb', line 9 def initialize(key) @key = key.to_sym @label = nil @icon = nil @color = nil @order = nil @description = nil @dashboard = nil end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
7 8 9 |
# File 'lib/admin_suite/portal_definition.rb', line 7 def key @key end |
Instance Method Details
#color(value = nil) ⇒ Object
29 30 31 32 |
# File 'lib/admin_suite/portal_definition.rb', line 29 def color(value = nil) @color = value if value.present? @color end |
#dashboard(&block) ⇒ Object
44 45 46 47 48 |
# File 'lib/admin_suite/portal_definition.rb', line 44 def dashboard(&block) @dashboard ||= UI::DashboardDefinition.new UI::DashboardDSL.new(@dashboard).instance_eval(&block) if block_given? @dashboard end |
#dashboard_definition ⇒ Object
50 51 52 |
# File 'lib/admin_suite/portal_definition.rb', line 50 def dashboard_definition @dashboard end |
#description(value = nil) ⇒ Object
39 40 41 42 |
# File 'lib/admin_suite/portal_definition.rb', line 39 def description(value = nil) @description = value if value.present? @description end |
#icon(value = nil) ⇒ Object
24 25 26 27 |
# File 'lib/admin_suite/portal_definition.rb', line 24 def icon(value = nil) @icon = value if value.present? @icon end |
#label(value = nil) ⇒ Object
19 20 21 22 |
# File 'lib/admin_suite/portal_definition.rb', line 19 def label(value = nil) @label = value if value.present? @label end |
#order(value = nil) ⇒ Object
34 35 36 37 |
# File 'lib/admin_suite/portal_definition.rb', line 34 def order(value = nil) @order = value unless value.nil? @order end |
#to_nav_meta ⇒ Object
54 55 56 57 58 59 60 61 62 |
# File 'lib/admin_suite/portal_definition.rb', line 54 def { label: @label, icon: @icon, color: @color, order: @order, description: @description }.compact end |