Method: CDEKApiClient::Entities::Location#initialize

Defined in:
lib/cdek_api_client/entities/location.rb

#initialize(code:, city: nil, address: nil) ⇒ Location

Initializes a new Location object.

Parameters:

  • code (Integer)

    the code of the location.

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

    the city of the location.

  • address (String, nil) (defaults to: nil)

    the address of the location.

Raises:

  • (ArgumentError)

    if any attribute validation fails.



22
23
24
25
26
27
# File 'lib/cdek_api_client/entities/location.rb', line 22

def initialize(code:, city: nil, address: nil)
  @code = code
  @city = city
  @address = address
  validate!
end