Class: Avo::Resources::Controls::BaseControl
- Inherits:
-
Object
- Object
- Avo::Resources::Controls::BaseControl
- Defined in:
- lib/avo/resources/controls/base_control.rb
Direct Known Subclasses
ActionsList, AttachButton, BackButton, CreateButton, DeleteButton, DetachButton, EditButton, OrderControls, SaveButton, ShowButton
Instance Attribute Summary collapse
-
#as_index_control ⇒ Object
readonly
Returns the value of attribute as_index_control.
-
#color ⇒ Object
readonly
Returns the value of attribute color.
-
#confirmation_message ⇒ Object
readonly
Returns the value of attribute confirmation_message.
-
#icon ⇒ Object
readonly
Returns the value of attribute icon.
-
#icon_class ⇒ Object
readonly
Returns the value of attribute icon_class.
-
#label ⇒ Object
readonly
Returns the value of attribute label.
-
#size ⇒ Object
readonly
Returns the value of attribute size.
-
#style ⇒ Object
readonly
Returns the value of attribute style.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
-
#initialize(**args) ⇒ BaseControl
constructor
A new instance of BaseControl.
- #type ⇒ Object
Constructor Details
#initialize(**args) ⇒ BaseControl
Returns a new instance of BaseControl.
7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/avo/resources/controls/base_control.rb', line 7 def initialize(**args) @label = args[:label] @title = args[:title] @color = args[:color] || :gray @style = args[:style] || :text @icon = args[:icon] @icon_class = @style == :icon ? " text-gray-600 h-6 hover:text-gray-600" : "" @confirmation_message = args[:confirmation_message] @size = args[:size] || :md @as_index_control = args[:as_index_control] end |
Instance Attribute Details
#as_index_control ⇒ Object (readonly)
Returns the value of attribute as_index_control.
5 6 7 |
# File 'lib/avo/resources/controls/base_control.rb', line 5 def as_index_control @as_index_control end |
#color ⇒ Object (readonly)
Returns the value of attribute color.
5 6 7 |
# File 'lib/avo/resources/controls/base_control.rb', line 5 def color @color end |
#confirmation_message ⇒ Object (readonly)
Returns the value of attribute confirmation_message.
5 6 7 |
# File 'lib/avo/resources/controls/base_control.rb', line 5 def @confirmation_message end |
#icon ⇒ Object (readonly)
Returns the value of attribute icon.
5 6 7 |
# File 'lib/avo/resources/controls/base_control.rb', line 5 def icon @icon end |
#icon_class ⇒ Object (readonly)
Returns the value of attribute icon_class.
5 6 7 |
# File 'lib/avo/resources/controls/base_control.rb', line 5 def icon_class @icon_class end |
#label ⇒ Object (readonly)
Returns the value of attribute label.
5 6 7 |
# File 'lib/avo/resources/controls/base_control.rb', line 5 def label @label end |
#size ⇒ Object (readonly)
Returns the value of attribute size.
5 6 7 |
# File 'lib/avo/resources/controls/base_control.rb', line 5 def size @size end |
#style ⇒ Object (readonly)
Returns the value of attribute style.
5 6 7 |
# File 'lib/avo/resources/controls/base_control.rb', line 5 def style @style end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
5 6 7 |
# File 'lib/avo/resources/controls/base_control.rb', line 5 def title @title end |
Instance Method Details
#type ⇒ Object
19 20 21 |
# File 'lib/avo/resources/controls/base_control.rb', line 19 def type self.class.name.demodulize.underscore.to_sym end |