Class: SolidusAdmin::UI::Forms::Address::Component

Inherits:
BaseComponent
  • Object
show all
Defined in:
app/components/solidus_admin/ui/forms/address/component.rb

Instance Method Summary collapse

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_optionsObject



10
11
12
13
# File 'app/components/solidus_admin/ui/forms/address/component.rb', line 10

def state_options
  return [] unless @address.country
  @address.country.states.map { |s| [s.name, s.id] }
end