Class: SolidusAdmin::UI::Forms::Address::Component
- Inherits:
-
BaseComponent
- Object
- BaseComponent
- SolidusAdmin::UI::Forms::Address::Component
- Defined in:
- app/components/solidus_admin/ui/forms/address/component.rb
Instance Method Summary collapse
-
#initialize(address:, name:, disabled: false) ⇒ Component
constructor
A new instance of Component.
- #state_options ⇒ Object
Constructor Details
#initialize(address:, name:, disabled: false) ⇒ Component
Returns a new instance of Component.
4 5 6 7 8 |
# File 'app/components/solidus_admin/ui/forms/address/component.rb', line 4 def initialize(address:, name:, disabled: false) @address = address @name = name @disabled = disabled end |
Instance Method Details
#state_options ⇒ Object
10 11 12 13 |
# File 'app/components/solidus_admin/ui/forms/address/component.rb', line 10 def return [] unless @address.country @address.country.states.map { |s| [s.name, s.id] } end |