Class: FlexiAdmin::Components::Actions::SelectComponent

Inherits:
BaseComponent
  • Object
show all
Defined in:
lib/flexi_admin/components/actions/select_component.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(context: nil, scope: nil, label: "Akce") ⇒ SelectComponent

Returns a new instance of SelectComponent.

Raises:

  • (ArgumentError)


9
10
11
12
13
14
15
# File 'lib/flexi_admin/components/actions/select_component.rb', line 9

def initialize(context: nil, scope: nil, label: "Akce")
  @context = context
  @scope = scope || context&.scope
  @label = label

  raise ArgumentError, "context or scope is required" if context.blank? && scope.blank?
end

Instance Attribute Details

#labelObject (readonly)

Returns the value of attribute label.



5
6
7
# File 'lib/flexi_admin/components/actions/select_component.rb', line 5

def label
  @label
end

#scopeObject (readonly)

Returns the value of attribute scope.



5
6
7
# File 'lib/flexi_admin/components/actions/select_component.rb', line 5

def scope
  @scope
end