Class: Address

Inherits:
Struct
  • Object
show all
Defined in:
lib/glimmer-dsl-web/samples/hello/hello_component.rb,
lib/glimmer-dsl-web/samples/hello/hello_data_binding.rb,
lib/glimmer-dsl-web/samples/hello/hello_content_data_binding.rb

Constant Summary collapse

STATES =
{
  "AK"=>"Alaska",
  "AL"=>"Alabama",
  "AR"=>"Arkansas",
  "AS"=>"American Samoa",
  "AZ"=>"Arizona",
  "CA"=>"California",
  "CO"=>"Colorado",
  "CT"=>"Connecticut",
  "DC"=>"District of Columbia",
  "DE"=>"Delaware",
  "FL"=>"Florida",
  "GA"=>"Georgia",
  "GU"=>"Guam",
  "HI"=>"Hawaii",
  "IA"=>"Iowa",
  "ID"=>"Idaho",
  "IL"=>"Illinois",
  "IN"=>"Indiana",
  "KS"=>"Kansas",
  "KY"=>"Kentucky",
  "LA"=>"Louisiana",
  "MA"=>"Massachusetts",
  "MD"=>"Maryland",
  "ME"=>"Maine",
  "MI"=>"Michigan",
  "MN"=>"Minnesota",
  "MO"=>"Missouri",
  "MS"=>"Mississippi",
  "MT"=>"Montana",
  "NC"=>"North Carolina",
  "ND"=>"North Dakota",
  "NE"=>"Nebraska",
  "NH"=>"New Hampshire",
  "NJ"=>"New Jersey",
  "NM"=>"New Mexico",
  "NV"=>"Nevada",
  "NY"=>"New York",
  "OH"=>"Ohio",
  "OK"=>"Oklahoma",
  "OR"=>"Oregon",
  "PA"=>"Pennsylvania",
  "PR"=>"Puerto Rico",
  "RI"=>"Rhode Island",
  "SC"=>"South Carolina",
  "SD"=>"South Dakota",
  "TN"=>"Tennessee",
  "TX"=>"Texas",
  "UT"=>"Utah",
  "VA"=>"Virginia",
  "VI"=>"Virgin Islands",
  "VT"=>"Vermont",
  "WA"=>"Washington",
  "WI"=>"Wisconsin",
  "WV"=>"West Virginia",
  "WY"=>"Wyoming"
}

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#billing_and_shippingObject

Returns the value of attribute billing_and_shipping

Returns:

  • (Object)

    the current value of billing_and_shipping



24
25
26
# File 'lib/glimmer-dsl-web/samples/hello/hello_data_binding.rb', line 24

def billing_and_shipping
  @billing_and_shipping
end

#cityObject

Returns the value of attribute city

Returns:

  • (Object)

    the current value of city



24
25
26
# File 'lib/glimmer-dsl-web/samples/hello/hello_component.rb', line 24

def city
  @city
end

#full_nameObject

Returns the value of attribute full_name

Returns:

  • (Object)

    the current value of full_name



24
25
26
# File 'lib/glimmer-dsl-web/samples/hello/hello_component.rb', line 24

def full_name
  @full_name
end

#nameObject

Returns the value of attribute name.



26
27
28
# File 'lib/glimmer-dsl-web/samples/hello/hello_content_data_binding.rb', line 26

def name
  @name
end

#stateObject

Returns the value of attribute state

Returns:

  • (Object)

    the current value of state



24
25
26
# File 'lib/glimmer-dsl-web/samples/hello/hello_component.rb', line 24

def state
  @state
end

#streetObject

Returns the value of attribute street

Returns:

  • (Object)

    the current value of street



24
25
26
# File 'lib/glimmer-dsl-web/samples/hello/hello_component.rb', line 24

def street
  @street
end

#street2Object

Returns the value of attribute street2

Returns:

  • (Object)

    the current value of street2



24
25
26
# File 'lib/glimmer-dsl-web/samples/hello/hello_component.rb', line 24

def street2
  @street2
end

#textObject

Returns the value of attribute text.



25
26
27
# File 'lib/glimmer-dsl-web/samples/hello/hello_content_data_binding.rb', line 25

def text
  @text
end

#zipObject

Returns the value of attribute zip.



26
27
28
# File 'lib/glimmer-dsl-web/samples/hello/hello_content_data_binding.rb', line 26

def zip
  @zip
end

#zip_codeObject

Returns the value of attribute zip_code

Returns:

  • (Object)

    the current value of zip_code



24
25
26
# File 'lib/glimmer-dsl-web/samples/hello/hello_component.rb', line 24

def zip_code
  @zip_code
end

Instance Method Details

#state_codeObject



83
84
85
# File 'lib/glimmer-dsl-web/samples/hello/hello_component.rb', line 83

def state_code
  STATES.invert[state]
end

#state_code=(value) ⇒ Object



87
88
89
# File 'lib/glimmer-dsl-web/samples/hello/hello_component.rb', line 87

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

#summaryObject



91
92
93
# File 'lib/glimmer-dsl-web/samples/hello/hello_component.rb', line 91

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