Class: Straddle::Models::CustomerAddress

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/straddle/models/customer_address.rb,
sig/straddle/models/customer_address.rbs

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, inspect, #inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(address1:, city:, state:, zip:, address2: nil) ⇒ Object

Customer postal address. When provided, the object must include all required fields.

Parameters:

  • address1 (String) —

    Primary address line, such as a street address or PO Box.

  • city (String) —

    City, district, suburb, town, or village.

  • state (String) —

    Two-letter state code.

  • zip (String) —

    ZIP or postal code.

  • address2 (String, nil) (defaults to: nil) —

    Secondary address line, such as an apartment, suite, unit, or building.



# File 'lib/straddle/models/customer_address.rb', line 36

Instance Attribute Details

#address1 ⇒ String

Primary address line, such as a street address or PO Box.

Parameters:

  • value (String)

Returns:

  • (String)


10
# File 'lib/straddle/models/customer_address.rb', line 10

required :address1, String

#address2 ⇒ String?

Secondary address line, such as an apartment, suite, unit, or building.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


34
# File 'lib/straddle/models/customer_address.rb', line 34

optional :address2, String, nil?: true

#city ⇒ String

City, district, suburb, town, or village.

Parameters:

  • value (String)

Returns:

  • (String)


16
# File 'lib/straddle/models/customer_address.rb', line 16

required :city, String

#state ⇒ String

Two-letter state code.

Parameters:

  • value (String)

Returns:

  • (String)


22
# File 'lib/straddle/models/customer_address.rb', line 22

required :state, String

#zip ⇒ String

ZIP or postal code.

Parameters:

  • value (String)

Returns:

  • (String)


28
# File 'lib/straddle/models/customer_address.rb', line 28

required :zip, String

Instance Method Details

#to_hash ⇒ {

Returns:

  • ({)


31
# File 'sig/straddle/models/customer_address.rbs', line 31

def to_hash: -> {