lib/eml/uk/parameters/card/show.rb in eml-2.1.8 vs lib/eml/uk/parameters/card/show.rb in eml-2.2.0
- old
+ new
@@ -1,17 +1,17 @@
-# typed: true
+# typed: strict
# frozen_string_literal: true
module EML
module UK
class Parameters
module Card
class Show < ::EML::UK::Parameters
- REQUIRED_CONFIG = %i[program].freeze
- OPTIONAL_CONFIG = %i[search_parameter].freeze
+ REQUIRED_CONFIG = T.let(%i[program].freeze, T::Array[Symbol])
+ OPTIONAL_CONFIG = T.let(%i[search_parameter].freeze, T::Array[Symbol])
- FIELDS_OPTIONS = %i[
+ FIELDS_OPTIONS = T.let(%i[
account_expiration_date
activating_merchant_group_name
activating_merchant_group_uniquetag
activation_amount
activation_country
@@ -57,12 +57,21 @@
promotion_type_id
security_code
status
uri
unload_to_ach_fee
- ].freeze
+ ].freeze, T::Array[Symbol])
+ sig { params(params: T::Hash[Symbol, T.untyped]).void }
+ def initialize(params)
+ super
+
+ @fields = T.let(nil, T.nilable(String))
+ @log_balance_inquiry = T.let(nil, T.nilable(String))
+ @only_valid_status = T.let(nil, T.nilable(String))
+ end
+
sig { params(fields: T::Array[Symbol]).returns(String) }
def fields=(fields)
unless fields.first == :all
fields.each do |field|
validate_array(:fields, field, FIELDS_OPTIONS)
@@ -80,19 +89,19 @@
sig { params(only_valid_status: T::Boolean).returns(String) }
def only_valid_status=(only_valid_status)
@only_valid_status = only_valid_status.inspect
end
- sig { params(program: String).returns(String) }
+ sig { returns(T.nilable(String)) }
attr_accessor :program
sig { params(search_parameter: String).returns(String) }
def search_parameter=(search_parameter)
validate_search_parameter(search_parameter)
@search_parameter = search_parameter
end
- sig { params(security_code: String).returns(String) }
+ sig { returns(T.nilable(String)) }
attr_accessor :security_code
end
end
end
end