Class: Refinery::Menus::Linkable
- Inherits:
-
Object
- Object
- Refinery::Menus::Linkable
- Defined in:
- lib/refinery/menus/configuration.rb
Instance Attribute Summary collapse
-
#class_name ⇒ Object
Returns the value of attribute class_name.
-
#human_class_name ⇒ Object
Returns the value of attribute human_class_name.
-
#klass ⇒ Object
Returns the value of attribute klass.
-
#name_attribute ⇒ Object
Returns the value of attribute name_attribute.
Instance Method Summary collapse
-
#initialize(params) ⇒ Linkable
constructor
A new instance of Linkable.
Constructor Details
#initialize(params) ⇒ Linkable
Returns a new instance of Linkable.
20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/refinery/menus/configuration.rb', line 20 def initialize(params) if params.is_a? Hash @class_name = params[:class_name] @name_attribute = params[:name_attribute] elsif params.is_a? String @class_name = params @name_attribute = :name else raise 'Unknown link initialize params' end @klass = class_name.constantize @human_class_name = @klass.model_name.human end |
Instance Attribute Details
#class_name ⇒ Object
Returns the value of attribute class_name.
18 19 20 |
# File 'lib/refinery/menus/configuration.rb', line 18 def class_name @class_name end |
#human_class_name ⇒ Object
Returns the value of attribute human_class_name.
18 19 20 |
# File 'lib/refinery/menus/configuration.rb', line 18 def human_class_name @human_class_name end |
#klass ⇒ Object
Returns the value of attribute klass.
18 19 20 |
# File 'lib/refinery/menus/configuration.rb', line 18 def klass @klass end |
#name_attribute ⇒ Object
Returns the value of attribute name_attribute.
18 19 20 |
# File 'lib/refinery/menus/configuration.rb', line 18 def name_attribute @name_attribute end |