lib/whatsapp_sdk/resource/url.rb in whatsapp_sdk-0.3.2 vs lib/whatsapp_sdk/resource/url.rb in whatsapp_sdk-0.4.0
- old
+ new
@@ -1,21 +1,25 @@
# frozen_string_literal: true
+# typed: strict
module WhatsappSdk
module Resource
class Url
- attr_accessor :url, :type
+ extend T::Sig
- ADDRESS_TYPE = {
- home: "HOME",
- work: "WORK"
- }.freeze
+ sig { returns(String) }
+ attr_accessor :url
+ sig { returns(AddressType) }
+ attr_accessor :type
+
+ sig { params(url: String, type: AddressType).void }
def initialize(url:, type:)
@url = url
@type = type
end
+ sig { returns(T::Hash[T.untyped, T.untyped]) }
def to_h
{
url: @url,
type: @type
}