Class: MethodRuby::Models::Address

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/method_ruby/models/address.rb,
sig/method_ruby/models/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(city: nil, line1: nil, line2: nil, state: nil, zip: nil) ⇒ Object

Postal mailing address.

Parameters:

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

    City or locality.

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

    Primary street address line.

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

    Secondary address line such as apartment or suite.

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

    Two-letter state or province code when available.

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

    Postal code.



# File 'lib/method_ruby/models/address.rb', line 36


Instance Attribute Details

#city ⇒ String?

City or locality.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


10
# File 'lib/method_ruby/models/address.rb', line 10

optional :city, String, nil?: true

#line1 ⇒ String?

Primary street address line.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


16
# File 'lib/method_ruby/models/address.rb', line 16

optional :line1, String, nil?: true

#line2 ⇒ String?

Secondary address line such as apartment or suite.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


22
# File 'lib/method_ruby/models/address.rb', line 22

optional :line2, String, nil?: true

#state ⇒ String?

Two-letter state or province code when available.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


28
# File 'lib/method_ruby/models/address.rb', line 28

optional :state, String, nil?: true

#zip ⇒ String?

Postal code.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


34
# File 'lib/method_ruby/models/address.rb', line 34

optional :zip, String, nil?: true

Instance Method Details

#to_hash ⇒ {

Returns:

  • ({)


31
# File 'sig/method_ruby/models/address.rbs', line 31

def to_hash: -> {