Skip to content

Commit d76a8b8

Browse files
committed
feat(sps_king): add sps_king gem sigs
1 parent 281fece commit d76a8b8

19 files changed

+324
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# If the test needs gem's RBS files, declare them here.
2+
#
3+
# additional_gems:
4+
# - GEM_NAME

gems/sps_king/0.4.0/_test/test.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Write Ruby code to test the RBS.
2+
# It is type checked by `steep check` command.
3+
4+
require "sps_king"

gems/sps_king/0.4.0/account.rbs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
module SPS
2+
class Account
3+
include ActiveModel::Validations
4+
extend ::SPS::Converter
5+
include ::SPS::Converter::InstanceMethods
6+
7+
attr_accessor name: ::String?
8+
attr_accessor iban: ::String?
9+
attr_accessor bic: ::String?
10+
11+
def initialize: (
12+
debtor_account_attributes_type attributes
13+
) -> void
14+
end
15+
end

gems/sps_king/0.4.0/converter.rbs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module SPS
2+
module Converter
3+
def convert: (
4+
*::Symbol,
5+
{ to: (:text | :decimal) } options
6+
) -> void
7+
end
8+
end
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
module SPS
2+
module Converter
3+
module InstanceMethods
4+
def convert_decimal: (
5+
?(::BigDecimal | ::String | ::Numeric)? value
6+
) -> ::BigDecimal?
7+
8+
def convert_text: (
9+
?(::String | ::Symbol | ::Numeric)? value
10+
) -> ::String?
11+
end
12+
end
13+
end
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
module SPS
2+
class CreditTransfer < ::SPS::Message
3+
attr_accessor account_class: ::SPS::DebtorAccount
4+
attr_accessor transaction_class: ::SPS::CreditTransferTransaction
5+
attr_accessor xml_main_tag: 'CstmrCdtTrfInitn'
6+
attr_accessor known_schemas: [schema_pain_001_type]
7+
8+
def initialize: (
9+
debtor_account_attributes_type account_options
10+
) -> self
11+
12+
def add_transaction: (
13+
credit_transfer_transaction_attributes_type options
14+
) -> void
15+
16+
def amount_total: (
17+
?::Array[::SPS::CreditTransferTransaction]? selected_transactions
18+
) -> ::BigDecimal
19+
20+
def transactions: -> ::Array[::SPS::CreditTransferTransaction]
21+
end
22+
end
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
module SPS
2+
class CreditTransferTransaction < ::SPS::Transaction
3+
include ActiveModel::Validations
4+
extend ::SPS::Converter
5+
include ::SPS::Converter::InstanceMethods
6+
7+
attr_accessor charge_bearer: charge_bearer_type
8+
attr_accessor service_level: ::String?
9+
attr_accessor category_purpose: ::String?
10+
11+
def initialize: (
12+
credit_transfer_transaction_attributes_type attributes
13+
) -> void
14+
end
15+
end
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
module SPS
2+
class CreditorAccount < ::SPS::Account
3+
include ActiveModel::Validations
4+
extend ::SPS::Converter
5+
include ::SPS::Converter::InstanceMethods
6+
7+
attr_accessor creditor_identifier: ::String
8+
attr_accessor isr_participant_number: ::String?
9+
10+
def initialize: (
11+
creditor_account_attributes_type attributes
12+
) -> void
13+
end
14+
end
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
module SPS
2+
class CreditorAddress
3+
include ActiveModel::Validations
4+
extend ::SPS::Converter
5+
include ::SPS::Converter::InstanceMethods
6+
7+
attr_accessor country_code: ::String
8+
attr_accessor address_line1: ::String
9+
attr_accessor address_line2: ::String
10+
attr_accessor street_name: ::String
11+
attr_accessor building_number: ::String
12+
attr_accessor post_code: ::String
13+
attr_accessor town_name: ::String
14+
15+
type separate_attributes = address_separate_type & {
16+
building_number: ::String,
17+
}
18+
19+
def initialize: ((address_line_based_type | separate_attributes) attributes) -> void
20+
end
21+
end
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
module SPS
2+
class DebtorAccount < ::SPS::Account
3+
include ActiveModel::Validations
4+
extend ::SPS::Converter
5+
include ::SPS::Converter::InstanceMethods
6+
7+
def initialize: (
8+
account_attributes_type account_options
9+
) -> self
10+
end
11+
end

0 commit comments

Comments
 (0)