Class: AddressForm::Address

Inherits:
Struct
  • Object
show all
Defined in:
lib/glimmer-dsl-web/samples/hello/hello_glimmer_component_helper/address_form.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#cityObject

Returns the value of attribute city

Returns:

  • (Object)

    the current value of city



4
5
6
# File 'lib/glimmer-dsl-web/samples/hello/hello_glimmer_component_helper/address_form.rb', line 4

def city
  @city
end

#full_nameObject

Returns the value of attribute full_name

Returns:

  • (Object)

    the current value of full_name



4
5
6
# File 'lib/glimmer-dsl-web/samples/hello/hello_glimmer_component_helper/address_form.rb', line 4

def full_name
  @full_name
end

#stateObject

Returns the value of attribute state

Returns:

  • (Object)

    the current value of state



4
5
6
# File 'lib/glimmer-dsl-web/samples/hello/hello_glimmer_component_helper/address_form.rb', line 4

def state
  @state
end

#streetObject

Returns the value of attribute street

Returns:

  • (Object)

    the current value of street



4
5
6
# File 'lib/glimmer-dsl-web/samples/hello/hello_glimmer_component_helper/address_form.rb', line 4

def street
  @street
end

#street2Object

Returns the value of attribute street2

Returns:

  • (Object)

    the current value of street2



4
5
6
# File 'lib/glimmer-dsl-web/samples/hello/hello_glimmer_component_helper/address_form.rb', line 4

def street2
  @street2
end

#zip_codeObject

Returns the value of attribute zip_code

Returns:

  • (Object)

    the current value of zip_code



4
5
6
# File 'lib/glimmer-dsl-web/samples/hello/hello_glimmer_component_helper/address_form.rb', line 4

def zip_code
  @zip_code
end

Instance Method Details

#state_codeObject



5
6
7
# File 'lib/glimmer-dsl-web/samples/hello/hello_glimmer_component_helper/address_form.rb', line 5

def state_code
  STATES.invert[state]
end

#state_code=(value) ⇒ Object



9
10
11
# File 'lib/glimmer-dsl-web/samples/hello/hello_glimmer_component_helper/address_form.rb', line 9

def state_code=(value)
  self.state = STATES[value]
end

#summaryObject



13
14
15
# File 'lib/glimmer-dsl-web/samples/hello/hello_glimmer_component_helper/address_form.rb', line 13

def summary
  to_h.values.map(&:to_s).reject(&:empty?).join(', ')
end