Sha256: ab00abb42222cac908ce441a7796c7b4ba729359bd8b5a6996864870160c1c35

Contents?: true

Size: 1.29 KB

Versions: 10

Compression:

Stored size: 1.29 KB

Contents

# typed: strict
# frozen_string_literal: true

module WhatsappSdk
  module Resource
    class Address
      extend T::Sig

      sig { returns(String) }
      attr_accessor :street

      sig { returns(String) }
      attr_accessor :city

      sig { returns(String) }
      attr_accessor :state

      sig { returns(String) }
      attr_accessor :zip

      sig { returns(String) }
      attr_accessor :country

      sig { returns(String) }
      attr_accessor :country_code

      sig { returns(AddressType) }
      attr_accessor :type

      sig do
        params(
          street: String, city: String, state: String, zip: String,
          country: String, country_code: String, type: AddressType
        ).void
      end
      def initialize(street:, city:, state:, zip:, country:, country_code:, type: AddressType::Home)
        @street = street
        @city = city
        @state = state
        @zip = zip
        @country = country
        @country_code = country_code
        @type = type
      end

      sig { returns(T::Hash[T.untyped, T.untyped]) }
      def to_h
        {
          street: @street,
          city: @city,
          state: @state,
          zip: @zip,
          country: @country,
          country_code: @country_code,
          type: @type
        }
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
whatsapp_sdk-0.12.1 lib/whatsapp_sdk/resource/address.rb
whatsapp_sdk-0.12.0 lib/whatsapp_sdk/resource/address.rb
whatsapp_sdk-0.11.0 lib/whatsapp_sdk/resource/address.rb
whatsapp_sdk-0.10.0 lib/whatsapp_sdk/resource/address.rb
whatsapp_sdk-0.9.2 lib/whatsapp_sdk/resource/address.rb
whatsapp_sdk-0.9.1 lib/whatsapp_sdk/resource/address.rb
whatsapp_sdk-0.9.0 lib/whatsapp_sdk/resource/address.rb
whatsapp_sdk-0.8.0 lib/whatsapp_sdk/resource/address.rb
whatsapp_sdk-0.7.3 lib/whatsapp_sdk/resource/address.rb
whatsapp_sdk-0.7.2 lib/whatsapp_sdk/resource/address.rb