stripe 10.9.0.pre.beta.1 → 10.10.0.pre.beta.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +18 -0
- data/Gemfile +3 -0
- data/Makefile +7 -0
- data/OPENAPI_VERSION +1 -1
- data/VERSION +1 -1
- data/bin/tapioca +27 -0
- data/lib/stripe/api_resource.rb +10 -1
- data/lib/stripe/api_resource_test_helpers.rb +6 -2
- data/lib/stripe/list_object.rb +3 -0
- data/lib/stripe/object_types.rb +142 -140
- data/lib/stripe/resources/account.rb +6 -4
- data/lib/stripe/resources/account_link.rb +3 -0
- data/lib/stripe/resources/account_notice.rb +3 -0
- data/lib/stripe/resources/account_session.rb +3 -0
- data/lib/stripe/resources/apple_pay_domain.rb +3 -0
- data/lib/stripe/resources/application_fee.rb +3 -0
- data/lib/stripe/resources/application_fee_refund.rb +3 -0
- data/lib/stripe/resources/apps/secret.rb +3 -0
- data/lib/stripe/resources/balance.rb +3 -0
- data/lib/stripe/resources/balance_transaction.rb +3 -0
- data/lib/stripe/resources/bank_account.rb +3 -0
- data/lib/stripe/resources/billing_portal/configuration.rb +3 -0
- data/lib/stripe/resources/billing_portal/session.rb +3 -0
- data/lib/stripe/resources/capability.rb +3 -0
- data/lib/stripe/resources/capital/financing_offer.rb +3 -0
- data/lib/stripe/resources/capital/financing_summary.rb +3 -0
- data/lib/stripe/resources/capital/financing_transaction.rb +3 -0
- data/lib/stripe/resources/card.rb +3 -0
- data/lib/stripe/resources/cash_balance.rb +3 -0
- data/lib/stripe/resources/charge.rb +3 -0
- data/lib/stripe/resources/checkout/session.rb +3 -0
- data/lib/stripe/resources/climate/order.rb +3 -0
- data/lib/stripe/resources/climate/product.rb +3 -0
- data/lib/stripe/resources/climate/supplier.rb +3 -0
- data/lib/stripe/resources/confirmation_token.rb +3 -0
- data/lib/stripe/resources/country_spec.rb +3 -0
- data/lib/stripe/resources/coupon.rb +3 -0
- data/lib/stripe/resources/credit_note.rb +3 -0
- data/lib/stripe/resources/credit_note_line_item.rb +3 -0
- data/lib/stripe/resources/customer.rb +8 -3
- data/lib/stripe/resources/customer_balance_transaction.rb +3 -0
- data/lib/stripe/resources/customer_cash_balance_transaction.rb +3 -0
- data/lib/stripe/resources/customer_entitlement.rb +3 -0
- data/lib/stripe/resources/customer_entitlement_summary.rb +3 -0
- data/lib/stripe/resources/customer_session.rb +3 -0
- data/lib/stripe/resources/discount.rb +3 -0
- data/lib/stripe/resources/dispute.rb +3 -0
- data/lib/stripe/resources/entitlements/event.rb +3 -0
- data/lib/stripe/resources/entitlements/feature.rb +3 -0
- data/lib/stripe/resources/ephemeral_key.rb +3 -0
- data/lib/stripe/resources/event.rb +3 -0
- data/lib/stripe/resources/exchange_rate.rb +3 -0
- data/lib/stripe/resources/file.rb +6 -0
- data/lib/stripe/resources/file_link.rb +3 -0
- data/lib/stripe/resources/financial_connections/account.rb +3 -0
- data/lib/stripe/resources/financial_connections/account_inferred_balance.rb +3 -0
- data/lib/stripe/resources/financial_connections/account_owner.rb +3 -0
- data/lib/stripe/resources/financial_connections/account_ownership.rb +3 -0
- data/lib/stripe/resources/financial_connections/session.rb +3 -0
- data/lib/stripe/resources/financial_connections/transaction.rb +3 -0
- data/lib/stripe/resources/funding_instructions.rb +3 -0
- data/lib/stripe/resources/gift_cards/card.rb +3 -0
- data/lib/stripe/resources/gift_cards/transaction.rb +3 -0
- data/lib/stripe/resources/identity/verification_report.rb +3 -0
- data/lib/stripe/resources/identity/verification_session.rb +3 -0
- data/lib/stripe/resources/invoice.rb +3 -0
- data/lib/stripe/resources/invoice_item.rb +3 -0
- data/lib/stripe/resources/invoice_line_item.rb +3 -0
- data/lib/stripe/resources/invoice_payment.rb +3 -0
- data/lib/stripe/resources/issuing/authorization.rb +6 -0
- data/lib/stripe/resources/issuing/card.rb +6 -0
- data/lib/stripe/resources/issuing/cardholder.rb +3 -0
- data/lib/stripe/resources/issuing/credit_underwriting_record.rb +3 -0
- data/lib/stripe/resources/issuing/dispute.rb +3 -0
- data/lib/stripe/resources/issuing/personalization_design.rb +6 -0
- data/lib/stripe/resources/issuing/physical_bundle.rb +3 -0
- data/lib/stripe/resources/issuing/token.rb +3 -0
- data/lib/stripe/resources/issuing/transaction.rb +6 -0
- data/lib/stripe/resources/line_item.rb +3 -0
- data/lib/stripe/resources/login_link.rb +3 -0
- data/lib/stripe/resources/mandate.rb +3 -0
- data/lib/stripe/resources/margin.rb +3 -0
- data/lib/stripe/resources/order.rb +3 -0
- data/lib/stripe/resources/payment_intent.rb +55 -4
- data/lib/stripe/resources/payment_link.rb +3 -0
- data/lib/stripe/resources/payment_method.rb +3 -0
- data/lib/stripe/resources/payment_method_configuration.rb +3 -0
- data/lib/stripe/resources/payment_method_domain.rb +3 -0
- data/lib/stripe/resources/payout.rb +3 -0
- data/lib/stripe/resources/person.rb +3 -0
- data/lib/stripe/resources/plan.rb +3 -0
- data/lib/stripe/resources/price.rb +3 -0
- data/lib/stripe/resources/product.rb +3 -0
- data/lib/stripe/resources/promotion_code.rb +3 -0
- data/lib/stripe/resources/quote.rb +3 -0
- data/lib/stripe/resources/quote_phase.rb +3 -0
- data/lib/stripe/resources/quote_preview_invoice.rb +3 -0
- data/lib/stripe/resources/quote_preview_subscription_schedule.rb +3 -0
- data/lib/stripe/resources/radar/early_fraud_warning.rb +3 -0
- data/lib/stripe/resources/radar/value_list.rb +3 -0
- data/lib/stripe/resources/radar/value_list_item.rb +3 -0
- data/lib/stripe/resources/refund.rb +6 -0
- data/lib/stripe/resources/reporting/report_run.rb +3 -0
- data/lib/stripe/resources/reporting/report_type.rb +3 -0
- data/lib/stripe/resources/reversal.rb +3 -0
- data/lib/stripe/resources/review.rb +3 -0
- data/lib/stripe/resources/setup_attempt.rb +3 -0
- data/lib/stripe/resources/setup_intent.rb +3 -0
- data/lib/stripe/resources/shipping_rate.rb +3 -0
- data/lib/stripe/resources/sigma/scheduled_query_run.rb +3 -0
- data/lib/stripe/resources/source.rb +3 -0
- data/lib/stripe/resources/source_transaction.rb +3 -0
- data/lib/stripe/resources/subscription.rb +3 -0
- data/lib/stripe/resources/subscription_item.rb +3 -0
- data/lib/stripe/resources/subscription_schedule.rb +3 -0
- data/lib/stripe/resources/tax/calculation.rb +3 -0
- data/lib/stripe/resources/tax/calculation_line_item.rb +3 -0
- data/lib/stripe/resources/tax/form.rb +3 -0
- data/lib/stripe/resources/tax/registration.rb +3 -0
- data/lib/stripe/resources/tax/settings.rb +3 -0
- data/lib/stripe/resources/tax/transaction.rb +3 -0
- data/lib/stripe/resources/tax/transaction_line_item.rb +3 -0
- data/lib/stripe/resources/tax_code.rb +3 -0
- data/lib/stripe/resources/tax_id.rb +5 -4
- data/lib/stripe/resources/tax_rate.rb +3 -0
- data/lib/stripe/resources/terminal/configuration.rb +3 -0
- data/lib/stripe/resources/terminal/connection_token.rb +3 -0
- data/lib/stripe/resources/terminal/location.rb +3 -0
- data/lib/stripe/resources/terminal/reader.rb +6 -0
- data/lib/stripe/resources/test_helpers/test_clock.rb +3 -0
- data/lib/stripe/resources/token.rb +3 -0
- data/lib/stripe/resources/topup.rb +3 -0
- data/lib/stripe/resources/transfer.rb +3 -0
- data/lib/stripe/resources/treasury/credit_reversal.rb +3 -0
- data/lib/stripe/resources/treasury/debit_reversal.rb +3 -0
- data/lib/stripe/resources/treasury/financial_account.rb +3 -0
- data/lib/stripe/resources/treasury/financial_account_features.rb +3 -0
- data/lib/stripe/resources/treasury/inbound_transfer.rb +6 -0
- data/lib/stripe/resources/treasury/outbound_payment.rb +6 -0
- data/lib/stripe/resources/treasury/outbound_transfer.rb +6 -0
- data/lib/stripe/resources/treasury/received_credit.rb +6 -0
- data/lib/stripe/resources/treasury/received_debit.rb +6 -0
- data/lib/stripe/resources/treasury/transaction.rb +3 -0
- data/lib/stripe/resources/treasury/transaction_entry.rb +3 -0
- data/lib/stripe/resources/usage_record.rb +3 -0
- data/lib/stripe/resources/usage_record_summary.rb +3 -0
- data/lib/stripe/resources/webhook_endpoint.rb +3 -0
- data/lib/stripe/search_result_object.rb +3 -0
- data/lib/stripe/singleton_api_resource.rb +1 -1
- data/lib/stripe/version.rb +1 -1
- data/sorbet/config +4 -0
- data/sorbet/rbi/annotations/.gitattributes +1 -0
- data/sorbet/rbi/annotations/coveralls_reborn.rbi +3 -0
- data/sorbet/rbi/gems/.gitattributes +1 -0
- data/sorbet/rbi/gems/addressable@2.8.6.rbi +1993 -0
- data/sorbet/rbi/gems/ast@2.4.2.rbi +584 -0
- data/sorbet/rbi/gems/byebug@11.1.3.rbi +3606 -0
- data/sorbet/rbi/gems/coderay@1.1.3.rbi +3437 -0
- data/sorbet/rbi/gems/coveralls_reborn@0.25.0.rbi +8 -0
- data/sorbet/rbi/gems/crack@0.4.5.rbi +144 -0
- data/sorbet/rbi/gems/docile@1.4.0.rbi +8 -0
- data/sorbet/rbi/gems/erubi@1.12.0.rbi +146 -0
- data/sorbet/rbi/gems/hashdiff@1.1.0.rbi +352 -0
- data/sorbet/rbi/gems/jaro_winkler@1.5.4.rbi +19 -0
- data/sorbet/rbi/gems/json@2.7.1.rbi +1561 -0
- data/sorbet/rbi/gems/language_server-protocol@3.17.0.3.rbi +14237 -0
- data/sorbet/rbi/gems/method_source@1.0.0.rbi +272 -0
- data/sorbet/rbi/gems/mocha@1.16.1.rbi +11 -0
- data/sorbet/rbi/gems/netrc@0.11.0.rbi +161 -0
- data/sorbet/rbi/gems/parallel@1.24.0.rbi +280 -0
- data/sorbet/rbi/gems/parser@3.2.2.4.rbi +9454 -0
- data/sorbet/rbi/gems/power_assert@2.0.3.rbi +414 -0
- data/sorbet/rbi/gems/prettier_print@1.2.1.rbi +951 -0
- data/sorbet/rbi/gems/prism@0.19.0.rbi +29883 -0
- data/sorbet/rbi/gems/pry-byebug@3.10.1.rbi +1150 -0
- data/sorbet/rbi/gems/pry@0.14.2.rbi +10085 -0
- data/sorbet/rbi/gems/public_suffix@5.0.4.rbi +931 -0
- data/sorbet/rbi/gems/racc@1.7.3.rbi +161 -0
- data/sorbet/rbi/gems/rack@3.0.8.rbi +5193 -0
- data/sorbet/rbi/gems/rainbow@3.1.1.rbi +402 -0
- data/sorbet/rbi/gems/rake@13.1.0.rbi +2884 -0
- data/sorbet/rbi/gems/rbi@0.1.6.rbi +2922 -0
- data/sorbet/rbi/gems/regexp_parser@2.8.3.rbi +3766 -0
- data/sorbet/rbi/gems/rexml@3.2.6.rbi +4887 -0
- data/sorbet/rbi/gems/rubocop-ast@1.30.0.rbi +7004 -0
- data/sorbet/rbi/gems/rubocop@1.57.2.rbi +56919 -0
- data/sorbet/rbi/gems/ruby-progressbar@1.13.0.rbi +1317 -0
- data/sorbet/rbi/gems/shoulda-context@2.0.0.rbi +555 -0
- data/sorbet/rbi/gems/simplecov-html@0.12.3.rbi +8 -0
- data/sorbet/rbi/gems/simplecov@0.21.2.rbi +8 -0
- data/sorbet/rbi/gems/simplecov_json_formatter@0.1.4.rbi +8 -0
- data/sorbet/rbi/gems/spoom@1.2.4.rbi +3777 -0
- data/sorbet/rbi/gems/sync@0.5.0.rbi +8 -0
- data/sorbet/rbi/gems/syntax_tree@6.2.0.rbi +23136 -0
- data/sorbet/rbi/gems/tapioca@0.11.17.rbi +3503 -0
- data/sorbet/rbi/gems/term-ansicolor@1.7.1.rbi +8 -0
- data/sorbet/rbi/gems/test-unit@3.6.1.rbi +4403 -0
- data/sorbet/rbi/gems/thor@1.3.0.rbi +4345 -0
- data/sorbet/rbi/gems/tins@1.32.1.rbi +8 -0
- data/sorbet/rbi/gems/unicode-display_width@2.5.0.rbi +65 -0
- data/sorbet/rbi/gems/webmock@3.19.1.rbi +1740 -0
- data/sorbet/rbi/gems/yard-sorbet@0.8.1.rbi +428 -0
- data/sorbet/rbi/gems/yard@0.9.34.rbi +18219 -0
- data/sorbet/tapioca/config.yml +13 -0
- data/sorbet/tapioca/require.rb +4 -0
- metadata +59 -2
@@ -0,0 +1,931 @@
|
|
1
|
+
# typed: true
|
2
|
+
|
3
|
+
# DO NOT EDIT MANUALLY
|
4
|
+
# This is an autogenerated file for types exported from the `public_suffix` gem.
|
5
|
+
# Please instead update this file by running `bin/tapioca gem public_suffix`.
|
6
|
+
|
7
|
+
# source://public_suffix//lib/public_suffix/domain.rb#9
|
8
|
+
module PublicSuffix
|
9
|
+
class << self
|
10
|
+
# private
|
11
|
+
#
|
12
|
+
# source://public_suffix//lib/public_suffix.rb#149
|
13
|
+
def decompose(name, rule); end
|
14
|
+
|
15
|
+
# Attempt to parse the name and returns the domain, if valid.
|
16
|
+
#
|
17
|
+
# This method doesn't raise. Instead, it returns nil if the domain is not valid for whatever reason.
|
18
|
+
#
|
19
|
+
# @param name [#to_s] The domain name or fully qualified domain name to parse.
|
20
|
+
# @param list [PublicSuffix::List] The rule list to search, defaults to the default {PublicSuffix::List}
|
21
|
+
# @param ignore_private [Boolean]
|
22
|
+
# @return [String]
|
23
|
+
#
|
24
|
+
# source://public_suffix//lib/public_suffix.rb#140
|
25
|
+
def domain(name, **options); end
|
26
|
+
|
27
|
+
# Pretend we know how to deal with user input.
|
28
|
+
#
|
29
|
+
# source://public_suffix//lib/public_suffix.rb#164
|
30
|
+
def normalize(name); end
|
31
|
+
|
32
|
+
# Parses +name+ and returns the {PublicSuffix::Domain} instance.
|
33
|
+
#
|
34
|
+
# @example Parse a valid domain
|
35
|
+
# PublicSuffix.parse("google.com")
|
36
|
+
# # => #<PublicSuffix::Domain:0x007fec2e51e588 @sld="google", @tld="com", @trd=nil>
|
37
|
+
# @example Parse a valid subdomain
|
38
|
+
# PublicSuffix.parse("www.google.com")
|
39
|
+
# # => #<PublicSuffix::Domain:0x007fec276d4cf8 @sld="google", @tld="com", @trd="www">
|
40
|
+
# @example Parse a fully qualified domain
|
41
|
+
# PublicSuffix.parse("google.com.")
|
42
|
+
# # => #<PublicSuffix::Domain:0x007fec257caf38 @sld="google", @tld="com", @trd=nil>
|
43
|
+
# @example Parse a fully qualified domain (subdomain)
|
44
|
+
# PublicSuffix.parse("www.google.com.")
|
45
|
+
# # => #<PublicSuffix::Domain:0x007fec27b6bca8 @sld="google", @tld="com", @trd="www">
|
46
|
+
# @example Parse an invalid (unlisted) domain
|
47
|
+
# PublicSuffix.parse("x.yz")
|
48
|
+
# # => #<PublicSuffix::Domain:0x007fec2f49bec0 @sld="x", @tld="yz", @trd=nil>
|
49
|
+
# @example Parse an invalid (unlisted) domain with strict checking (without applying the default * rule)
|
50
|
+
# PublicSuffix.parse("x.yz", default_rule: nil)
|
51
|
+
# # => PublicSuffix::DomainInvalid: `x.yz` is not a valid domain
|
52
|
+
# @example Parse an URL (not supported, only domains)
|
53
|
+
# PublicSuffix.parse("http://www.google.com")
|
54
|
+
# # => PublicSuffix::DomainInvalid: http://www.google.com is not expected to contain a scheme
|
55
|
+
# @param name [#to_s] The domain name or fully qualified domain name to parse.
|
56
|
+
# @param list [PublicSuffix::List] The rule list to search, defaults to the default {PublicSuffix::List}
|
57
|
+
# @param ignore_private [Boolean]
|
58
|
+
# @raise [PublicSuffix::DomainInvalid] If domain is not a valid domain.
|
59
|
+
# @raise [PublicSuffix::DomainNotAllowed] If a rule for +domain+ is found, but the rule doesn't allow +domain+.
|
60
|
+
# @return [PublicSuffix::Domain]
|
61
|
+
#
|
62
|
+
# source://public_suffix//lib/public_suffix.rb#67
|
63
|
+
def parse(name, list: T.unsafe(nil), default_rule: T.unsafe(nil), ignore_private: T.unsafe(nil)); end
|
64
|
+
|
65
|
+
# Checks whether +domain+ is assigned and allowed, without actually parsing it.
|
66
|
+
#
|
67
|
+
# This method doesn't care whether domain is a domain or subdomain.
|
68
|
+
# The validation is performed using the default {PublicSuffix::List}.
|
69
|
+
#
|
70
|
+
# @example Validate a valid domain
|
71
|
+
# PublicSuffix.valid?("example.com")
|
72
|
+
# # => true
|
73
|
+
# @example Validate a valid subdomain
|
74
|
+
# PublicSuffix.valid?("www.example.com")
|
75
|
+
# # => true
|
76
|
+
# @example Validate a not-listed domain
|
77
|
+
# PublicSuffix.valid?("example.tldnotlisted")
|
78
|
+
# # => true
|
79
|
+
# @example Validate a not-listed domain with strict checking (without applying the default * rule)
|
80
|
+
# PublicSuffix.valid?("example.tldnotlisted")
|
81
|
+
# # => true
|
82
|
+
# PublicSuffix.valid?("example.tldnotlisted", default_rule: nil)
|
83
|
+
# # => false
|
84
|
+
# @example Validate a fully qualified domain
|
85
|
+
# PublicSuffix.valid?("google.com.")
|
86
|
+
# # => true
|
87
|
+
# PublicSuffix.valid?("www.google.com.")
|
88
|
+
# # => true
|
89
|
+
# @example Check an URL (which is not a valid domain)
|
90
|
+
# PublicSuffix.valid?("http://www.example.com")
|
91
|
+
# # => false
|
92
|
+
# @param name [#to_s] The domain name or fully qualified domain name to validate.
|
93
|
+
# @param ignore_private [Boolean]
|
94
|
+
# @return [Boolean]
|
95
|
+
#
|
96
|
+
# source://public_suffix//lib/public_suffix.rb#123
|
97
|
+
def valid?(name, list: T.unsafe(nil), default_rule: T.unsafe(nil), ignore_private: T.unsafe(nil)); end
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
# source://public_suffix//lib/public_suffix.rb#26
|
102
|
+
PublicSuffix::BANG = T.let(T.unsafe(nil), String)
|
103
|
+
|
104
|
+
# source://public_suffix//lib/public_suffix.rb#25
|
105
|
+
PublicSuffix::DOT = T.let(T.unsafe(nil), String)
|
106
|
+
|
107
|
+
# Domain represents a domain name, composed by a TLD, SLD and TRD.
|
108
|
+
#
|
109
|
+
# source://public_suffix//lib/public_suffix/domain.rb#12
|
110
|
+
class PublicSuffix::Domain
|
111
|
+
# Creates and returns a new {PublicSuffix::Domain} instance.
|
112
|
+
#
|
113
|
+
# @example Initialize with a TLD and SLD
|
114
|
+
# PublicSuffix::Domain.new("com", "example")
|
115
|
+
# # => #<PublicSuffix::Domain @tld="com", @trd=nil>
|
116
|
+
# @example Initialize with a TLD
|
117
|
+
# PublicSuffix::Domain.new("com")
|
118
|
+
# # => #<PublicSuffix::Domain @tld="com">
|
119
|
+
# @example Initialize with a TLD, SLD and TRD
|
120
|
+
# PublicSuffix::Domain.new("com", "example", "wwww")
|
121
|
+
# # => #<PublicSuffix::Domain @tld="com", @trd=nil, @sld="example">
|
122
|
+
# @overload initialize
|
123
|
+
# @overload initialize
|
124
|
+
# @overload initialize
|
125
|
+
# @return [Domain] a new instance of Domain
|
126
|
+
# @yield [self] Yields on self.
|
127
|
+
# @yieldparam self [PublicSuffix::Domain] The newly creates instance
|
128
|
+
#
|
129
|
+
# source://public_suffix//lib/public_suffix/domain.rb#65
|
130
|
+
def initialize(*args); end
|
131
|
+
|
132
|
+
# Returns a domain-like representation of this object
|
133
|
+
# if the object is a {#domain?}, <tt>nil</tt> otherwise.
|
134
|
+
#
|
135
|
+
# PublicSuffix::Domain.new("com").domain
|
136
|
+
# # => nil
|
137
|
+
#
|
138
|
+
# PublicSuffix::Domain.new("com", "google").domain
|
139
|
+
# # => "google.com"
|
140
|
+
#
|
141
|
+
# PublicSuffix::Domain.new("com", "google", "www").domain
|
142
|
+
# # => "www.google.com"
|
143
|
+
#
|
144
|
+
# This method doesn't validate the input. It handles the domain
|
145
|
+
# as a valid domain name and simply applies the necessary transformations.
|
146
|
+
#
|
147
|
+
# This method returns a FQD, not just the domain part.
|
148
|
+
# To get the domain part, use <tt>#sld</tt> (aka second level domain).
|
149
|
+
#
|
150
|
+
# PublicSuffix::Domain.new("com", "google", "www").domain
|
151
|
+
# # => "google.com"
|
152
|
+
#
|
153
|
+
# PublicSuffix::Domain.new("com", "google", "www").sld
|
154
|
+
# # => "google"
|
155
|
+
#
|
156
|
+
# @return [String]
|
157
|
+
# @see #domain?
|
158
|
+
# @see #subdomain
|
159
|
+
#
|
160
|
+
# source://public_suffix//lib/public_suffix/domain.rb#137
|
161
|
+
def domain; end
|
162
|
+
|
163
|
+
# Checks whether <tt>self</tt> looks like a domain.
|
164
|
+
#
|
165
|
+
# This method doesn't actually validate the domain.
|
166
|
+
# It only checks whether the instance contains
|
167
|
+
# a value for the {#tld} and {#sld} attributes.
|
168
|
+
#
|
169
|
+
# @example
|
170
|
+
#
|
171
|
+
# PublicSuffix::Domain.new("com").domain?
|
172
|
+
# # => false
|
173
|
+
#
|
174
|
+
# PublicSuffix::Domain.new("com", "google").domain?
|
175
|
+
# # => true
|
176
|
+
#
|
177
|
+
# PublicSuffix::Domain.new("com", "google", "www").domain?
|
178
|
+
# # => true
|
179
|
+
#
|
180
|
+
# # This is an invalid domain, but returns true
|
181
|
+
# # because this method doesn't validate the content.
|
182
|
+
# PublicSuffix::Domain.new("com", nil).domain?
|
183
|
+
# # => true
|
184
|
+
# @return [Boolean]
|
185
|
+
# @see #subdomain?
|
186
|
+
#
|
187
|
+
# source://public_suffix//lib/public_suffix/domain.rb#198
|
188
|
+
def domain?; end
|
189
|
+
|
190
|
+
# Returns the full domain name.
|
191
|
+
#
|
192
|
+
# @example Gets the domain name of a domain
|
193
|
+
# PublicSuffix::Domain.new("com", "google").name
|
194
|
+
# # => "google.com"
|
195
|
+
# @example Gets the domain name of a subdomain
|
196
|
+
# PublicSuffix::Domain.new("com", "google", "www").name
|
197
|
+
# # => "www.google.com"
|
198
|
+
# @return [String]
|
199
|
+
#
|
200
|
+
# source://public_suffix//lib/public_suffix/domain.rb#105
|
201
|
+
def name; end
|
202
|
+
|
203
|
+
# Returns the value of attribute sld.
|
204
|
+
#
|
205
|
+
# source://public_suffix//lib/public_suffix/domain.rb#33
|
206
|
+
def sld; end
|
207
|
+
|
208
|
+
# Returns a subdomain-like representation of this object
|
209
|
+
# if the object is a {#subdomain?}, <tt>nil</tt> otherwise.
|
210
|
+
#
|
211
|
+
# PublicSuffix::Domain.new("com").subdomain
|
212
|
+
# # => nil
|
213
|
+
#
|
214
|
+
# PublicSuffix::Domain.new("com", "google").subdomain
|
215
|
+
# # => nil
|
216
|
+
#
|
217
|
+
# PublicSuffix::Domain.new("com", "google", "www").subdomain
|
218
|
+
# # => "www.google.com"
|
219
|
+
#
|
220
|
+
# This method doesn't validate the input. It handles the domain
|
221
|
+
# as a valid domain name and simply applies the necessary transformations.
|
222
|
+
#
|
223
|
+
# This method returns a FQD, not just the subdomain part.
|
224
|
+
# To get the subdomain part, use <tt>#trd</tt> (aka third level domain).
|
225
|
+
#
|
226
|
+
# PublicSuffix::Domain.new("com", "google", "www").subdomain
|
227
|
+
# # => "www.google.com"
|
228
|
+
#
|
229
|
+
# PublicSuffix::Domain.new("com", "google", "www").trd
|
230
|
+
# # => "www"
|
231
|
+
#
|
232
|
+
# @return [String]
|
233
|
+
# @see #subdomain?
|
234
|
+
# @see #domain
|
235
|
+
#
|
236
|
+
# source://public_suffix//lib/public_suffix/domain.rb#169
|
237
|
+
def subdomain; end
|
238
|
+
|
239
|
+
# Checks whether <tt>self</tt> looks like a subdomain.
|
240
|
+
#
|
241
|
+
# This method doesn't actually validate the subdomain.
|
242
|
+
# It only checks whether the instance contains
|
243
|
+
# a value for the {#tld}, {#sld} and {#trd} attributes.
|
244
|
+
# If you also want to validate the domain,
|
245
|
+
# use {#valid_subdomain?} instead.
|
246
|
+
#
|
247
|
+
# @example
|
248
|
+
#
|
249
|
+
# PublicSuffix::Domain.new("com").subdomain?
|
250
|
+
# # => false
|
251
|
+
#
|
252
|
+
# PublicSuffix::Domain.new("com", "google").subdomain?
|
253
|
+
# # => false
|
254
|
+
#
|
255
|
+
# PublicSuffix::Domain.new("com", "google", "www").subdomain?
|
256
|
+
# # => true
|
257
|
+
#
|
258
|
+
# # This is an invalid domain, but returns true
|
259
|
+
# # because this method doesn't validate the content.
|
260
|
+
# PublicSuffix::Domain.new("com", "example", nil).subdomain?
|
261
|
+
# # => true
|
262
|
+
# @return [Boolean]
|
263
|
+
# @see #domain?
|
264
|
+
#
|
265
|
+
# source://public_suffix//lib/public_suffix/domain.rb#229
|
266
|
+
def subdomain?; end
|
267
|
+
|
268
|
+
# Returns the value of attribute tld.
|
269
|
+
#
|
270
|
+
# source://public_suffix//lib/public_suffix/domain.rb#33
|
271
|
+
def tld; end
|
272
|
+
|
273
|
+
# Returns an array containing the domain parts.
|
274
|
+
#
|
275
|
+
# @example
|
276
|
+
#
|
277
|
+
# PublicSuffix::Domain.new("google.com").to_a
|
278
|
+
# # => [nil, "google", "com"]
|
279
|
+
#
|
280
|
+
# PublicSuffix::Domain.new("www.google.com").to_a
|
281
|
+
# # => [nil, "google", "com"]
|
282
|
+
# @return [Array<String, nil>]
|
283
|
+
#
|
284
|
+
# source://public_suffix//lib/public_suffix/domain.rb#89
|
285
|
+
def to_a; end
|
286
|
+
|
287
|
+
# Returns a string representation of this object.
|
288
|
+
#
|
289
|
+
# @return [String]
|
290
|
+
#
|
291
|
+
# source://public_suffix//lib/public_suffix/domain.rb#73
|
292
|
+
def to_s; end
|
293
|
+
|
294
|
+
# Returns the value of attribute trd.
|
295
|
+
#
|
296
|
+
# source://public_suffix//lib/public_suffix/domain.rb#33
|
297
|
+
def trd; end
|
298
|
+
|
299
|
+
class << self
|
300
|
+
# Splits a string into the labels, that is the dot-separated parts.
|
301
|
+
#
|
302
|
+
# The input is not validated, but it is assumed to be a valid domain name.
|
303
|
+
#
|
304
|
+
# @example
|
305
|
+
#
|
306
|
+
# name_to_labels('example.com')
|
307
|
+
# # => ['example', 'com']
|
308
|
+
#
|
309
|
+
# name_to_labels('example.co.uk')
|
310
|
+
# # => ['example', 'co', 'uk']
|
311
|
+
# @param name [String, #to_s] The domain name to split.
|
312
|
+
# @return [Array<String>]
|
313
|
+
#
|
314
|
+
# source://public_suffix//lib/public_suffix/domain.rb#28
|
315
|
+
def name_to_labels(name); end
|
316
|
+
end
|
317
|
+
end
|
318
|
+
|
319
|
+
# Raised when trying to parse an invalid name.
|
320
|
+
# A name is considered invalid when no rule is found in the definition list.
|
321
|
+
#
|
322
|
+
# @example
|
323
|
+
#
|
324
|
+
# PublicSuffix.parse("nic.test")
|
325
|
+
# # => PublicSuffix::DomainInvalid
|
326
|
+
#
|
327
|
+
# PublicSuffix.parse("http://www.nic.it")
|
328
|
+
# # => PublicSuffix::DomainInvalid
|
329
|
+
#
|
330
|
+
# source://public_suffix//lib/public_suffix/errors.rb#25
|
331
|
+
class PublicSuffix::DomainInvalid < ::PublicSuffix::Error; end
|
332
|
+
|
333
|
+
# Raised when trying to parse a name that matches a suffix.
|
334
|
+
#
|
335
|
+
# @example
|
336
|
+
#
|
337
|
+
# PublicSuffix.parse("nic.do")
|
338
|
+
# # => PublicSuffix::DomainNotAllowed
|
339
|
+
#
|
340
|
+
# PublicSuffix.parse("www.nic.do")
|
341
|
+
# # => PublicSuffix::Domain
|
342
|
+
#
|
343
|
+
# source://public_suffix//lib/public_suffix/errors.rb#38
|
344
|
+
class PublicSuffix::DomainNotAllowed < ::PublicSuffix::DomainInvalid; end
|
345
|
+
|
346
|
+
# source://public_suffix//lib/public_suffix/errors.rb#11
|
347
|
+
class PublicSuffix::Error < ::StandardError; end
|
348
|
+
|
349
|
+
# A {PublicSuffix::List} is a collection of one
|
350
|
+
# or more {PublicSuffix::Rule}.
|
351
|
+
#
|
352
|
+
# Given a {PublicSuffix::List},
|
353
|
+
# you can add or remove {PublicSuffix::Rule},
|
354
|
+
# iterate all items in the list or search for the first rule
|
355
|
+
# which matches a specific domain name.
|
356
|
+
#
|
357
|
+
# # Create a new list
|
358
|
+
# list = PublicSuffix::List.new
|
359
|
+
#
|
360
|
+
# # Push two rules to the list
|
361
|
+
# list << PublicSuffix::Rule.factory("it")
|
362
|
+
# list << PublicSuffix::Rule.factory("com")
|
363
|
+
#
|
364
|
+
# # Get the size of the list
|
365
|
+
# list.size
|
366
|
+
# # => 2
|
367
|
+
#
|
368
|
+
# # Search for the rule matching given domain
|
369
|
+
# list.find("example.com")
|
370
|
+
# # => #<PublicSuffix::Rule::Normal>
|
371
|
+
# list.find("example.org")
|
372
|
+
# # => nil
|
373
|
+
#
|
374
|
+
# You can create as many {PublicSuffix::List} you want.
|
375
|
+
# The {PublicSuffix::List.default} rule list is used
|
376
|
+
# to tokenize and validate a domain.
|
377
|
+
#
|
378
|
+
# source://public_suffix//lib/public_suffix/list.rb#40
|
379
|
+
class PublicSuffix::List
|
380
|
+
# Initializes an empty {PublicSuffix::List}.
|
381
|
+
#
|
382
|
+
# @return [List] a new instance of List
|
383
|
+
# @yield [self] Yields on self.
|
384
|
+
# @yieldparam self [PublicSuffix::List] The newly created instance.
|
385
|
+
#
|
386
|
+
# source://public_suffix//lib/public_suffix/list.rb#106
|
387
|
+
def initialize; end
|
388
|
+
|
389
|
+
# Adds the given object to the list and optionally refreshes the rule index.
|
390
|
+
#
|
391
|
+
# @param rule [PublicSuffix::Rule::*] the rule to add to the list
|
392
|
+
# @return [self]
|
393
|
+
#
|
394
|
+
# source://public_suffix//lib/public_suffix/list.rb#141
|
395
|
+
def <<(rule); end
|
396
|
+
|
397
|
+
# Checks whether two lists are equal.
|
398
|
+
#
|
399
|
+
# List <tt>one</tt> is equal to <tt>two</tt>, if <tt>two</tt> is an instance of
|
400
|
+
# {PublicSuffix::List} and each +PublicSuffix::Rule::*+
|
401
|
+
# in list <tt>one</tt> is available in list <tt>two</tt>, in the same order.
|
402
|
+
#
|
403
|
+
# @param other [PublicSuffix::List] the List to compare
|
404
|
+
# @return [Boolean]
|
405
|
+
#
|
406
|
+
# source://public_suffix//lib/public_suffix/list.rb#120
|
407
|
+
def ==(other); end
|
408
|
+
|
409
|
+
# Adds the given object to the list and optionally refreshes the rule index.
|
410
|
+
#
|
411
|
+
# @param rule [PublicSuffix::Rule::*] the rule to add to the list
|
412
|
+
# @return [self]
|
413
|
+
#
|
414
|
+
# source://public_suffix//lib/public_suffix/list.rb#141
|
415
|
+
def add(rule); end
|
416
|
+
|
417
|
+
# Removes all rules.
|
418
|
+
#
|
419
|
+
# @return [self]
|
420
|
+
#
|
421
|
+
# source://public_suffix//lib/public_suffix/list.rb#164
|
422
|
+
def clear; end
|
423
|
+
|
424
|
+
# Gets the default rule.
|
425
|
+
#
|
426
|
+
# @return [PublicSuffix::Rule::*]
|
427
|
+
# @see PublicSuffix::Rule.default_rule
|
428
|
+
#
|
429
|
+
# source://public_suffix//lib/public_suffix/list.rb#226
|
430
|
+
def default_rule; end
|
431
|
+
|
432
|
+
# Iterates each rule in the list.
|
433
|
+
#
|
434
|
+
# source://public_suffix//lib/public_suffix/list.rb#128
|
435
|
+
def each(&block); end
|
436
|
+
|
437
|
+
# Checks whether the list is empty.
|
438
|
+
#
|
439
|
+
# @return [Boolean]
|
440
|
+
#
|
441
|
+
# source://public_suffix//lib/public_suffix/list.rb#157
|
442
|
+
def empty?; end
|
443
|
+
|
444
|
+
# Checks whether two lists are equal.
|
445
|
+
#
|
446
|
+
# List <tt>one</tt> is equal to <tt>two</tt>, if <tt>two</tt> is an instance of
|
447
|
+
# {PublicSuffix::List} and each +PublicSuffix::Rule::*+
|
448
|
+
# in list <tt>one</tt> is available in list <tt>two</tt>, in the same order.
|
449
|
+
#
|
450
|
+
# @param other [PublicSuffix::List] the List to compare
|
451
|
+
# @return [Boolean]
|
452
|
+
#
|
453
|
+
# source://public_suffix//lib/public_suffix/list.rb#120
|
454
|
+
def eql?(other); end
|
455
|
+
|
456
|
+
# Finds and returns the rule corresponding to the longest public suffix for the hostname.
|
457
|
+
#
|
458
|
+
# @param name [#to_s] the hostname
|
459
|
+
# @param default [PublicSuffix::Rule::*] the default rule to return in case no rule matches
|
460
|
+
# @return [PublicSuffix::Rule::*]
|
461
|
+
#
|
462
|
+
# source://public_suffix//lib/public_suffix/list.rb#174
|
463
|
+
def find(name, default: T.unsafe(nil), **options); end
|
464
|
+
|
465
|
+
# Gets the number of rules in the list.
|
466
|
+
#
|
467
|
+
# @return [Integer]
|
468
|
+
#
|
469
|
+
# source://public_suffix//lib/public_suffix/list.rb#150
|
470
|
+
def size; end
|
471
|
+
|
472
|
+
protected
|
473
|
+
|
474
|
+
# Returns the value of attribute rules.
|
475
|
+
#
|
476
|
+
# source://public_suffix//lib/public_suffix/list.rb#233
|
477
|
+
def rules; end
|
478
|
+
|
479
|
+
private
|
480
|
+
|
481
|
+
# source://public_suffix//lib/public_suffix/list.rb#238
|
482
|
+
def entry_to_rule(entry, value); end
|
483
|
+
|
484
|
+
# source://public_suffix//lib/public_suffix/list.rb#242
|
485
|
+
def rule_to_entry(rule); end
|
486
|
+
|
487
|
+
# Selects all the rules matching given hostame.
|
488
|
+
#
|
489
|
+
# If `ignore_private` is set to true, the algorithm will skip the rules that are flagged as
|
490
|
+
# private domain. Note that the rules will still be part of the loop.
|
491
|
+
# If you frequently need to access lists ignoring the private domains,
|
492
|
+
# you should create a list that doesn't include these domains setting the
|
493
|
+
# `private_domains: false` option when calling {.parse}.
|
494
|
+
#
|
495
|
+
# Note that this method is currently private, as you should not rely on it. Instead,
|
496
|
+
# the public interface is {#find}. The current internal algorithm allows to return all
|
497
|
+
# matching rules, but different data structures may not be able to do it, and instead would
|
498
|
+
# return only the match. For this reason, you should rely on {#find}.
|
499
|
+
#
|
500
|
+
# @param name [#to_s] the hostname
|
501
|
+
# @param ignore_private [Boolean]
|
502
|
+
# @return [Array<PublicSuffix::Rule::*>]
|
503
|
+
#
|
504
|
+
# source://public_suffix//lib/public_suffix/list.rb#199
|
505
|
+
def select(name, ignore_private: T.unsafe(nil)); end
|
506
|
+
|
507
|
+
class << self
|
508
|
+
# Gets the default rule list.
|
509
|
+
#
|
510
|
+
# Initializes a new {PublicSuffix::List} parsing the content
|
511
|
+
# of {PublicSuffix::List.default_list_content}, if required.
|
512
|
+
#
|
513
|
+
# @return [PublicSuffix::List]
|
514
|
+
#
|
515
|
+
# source://public_suffix//lib/public_suffix/list.rb#50
|
516
|
+
def default(**options); end
|
517
|
+
|
518
|
+
# Sets the default rule list to +value+.
|
519
|
+
#
|
520
|
+
# @param value [PublicSuffix::List] the new list
|
521
|
+
# @return [PublicSuffix::List]
|
522
|
+
#
|
523
|
+
# source://public_suffix//lib/public_suffix/list.rb#58
|
524
|
+
def default=(value); end
|
525
|
+
|
526
|
+
# Parse given +input+ treating the content as Public Suffix List.
|
527
|
+
#
|
528
|
+
# See http://publicsuffix.org/format/ for more details about input format.
|
529
|
+
#
|
530
|
+
# @param input [#each_line] the list to parse
|
531
|
+
# @param private_domains [Boolean] whether to ignore the private domains section
|
532
|
+
# @return [PublicSuffix::List]
|
533
|
+
#
|
534
|
+
# source://public_suffix//lib/public_suffix/list.rb#69
|
535
|
+
def parse(input, private_domains: T.unsafe(nil)); end
|
536
|
+
end
|
537
|
+
end
|
538
|
+
|
539
|
+
# source://public_suffix//lib/public_suffix/list.rb#42
|
540
|
+
PublicSuffix::List::DEFAULT_LIST_PATH = T.let(T.unsafe(nil), String)
|
541
|
+
|
542
|
+
# A Rule is a special object which holds a single definition
|
543
|
+
# of the Public Suffix List.
|
544
|
+
#
|
545
|
+
# There are 3 types of rules, each one represented by a specific
|
546
|
+
# subclass within the +PublicSuffix::Rule+ namespace.
|
547
|
+
#
|
548
|
+
# To create a new Rule, use the {PublicSuffix::Rule#factory} method.
|
549
|
+
#
|
550
|
+
# PublicSuffix::Rule.factory("ar")
|
551
|
+
# # => #<PublicSuffix::Rule::Normal>
|
552
|
+
#
|
553
|
+
# source://public_suffix//lib/public_suffix/rule.rb#22
|
554
|
+
module PublicSuffix::Rule
|
555
|
+
class << self
|
556
|
+
# The default rule to use if no rule match.
|
557
|
+
#
|
558
|
+
# The default rule is "*". From https://publicsuffix.org/list/:
|
559
|
+
#
|
560
|
+
# > If no rules match, the prevailing rule is "*".
|
561
|
+
#
|
562
|
+
# @return [PublicSuffix::Rule::Wildcard] The default rule.
|
563
|
+
#
|
564
|
+
# source://public_suffix//lib/public_suffix/rule.rb#344
|
565
|
+
def default; end
|
566
|
+
|
567
|
+
# Takes the +name+ of the rule, detects the specific rule class
|
568
|
+
# and creates a new instance of that class.
|
569
|
+
# The +name+ becomes the rule +value+.
|
570
|
+
#
|
571
|
+
# @example Creates a Normal rule
|
572
|
+
# PublicSuffix::Rule.factory("ar")
|
573
|
+
# # => #<PublicSuffix::Rule::Normal>
|
574
|
+
# @example Creates a Wildcard rule
|
575
|
+
# PublicSuffix::Rule.factory("*.ar")
|
576
|
+
# # => #<PublicSuffix::Rule::Wildcard>
|
577
|
+
# @example Creates an Exception rule
|
578
|
+
# PublicSuffix::Rule.factory("!congresodelalengua3.ar")
|
579
|
+
# # => #<PublicSuffix::Rule::Exception>
|
580
|
+
# @param content [#to_s] the content of the rule
|
581
|
+
# @return [PublicSuffix::Rule::*] A rule instance.
|
582
|
+
#
|
583
|
+
# source://public_suffix//lib/public_suffix/rule.rb#326
|
584
|
+
def factory(content, private: T.unsafe(nil)); end
|
585
|
+
end
|
586
|
+
end
|
587
|
+
|
588
|
+
# = Abstract rule class
|
589
|
+
#
|
590
|
+
# This represent the base class for a Rule definition
|
591
|
+
# in the {Public Suffix List}[https://publicsuffix.org].
|
592
|
+
#
|
593
|
+
# This is intended to be an Abstract class
|
594
|
+
# and you shouldn't create a direct instance. The only purpose
|
595
|
+
# of this class is to expose a common interface
|
596
|
+
# for all the available subclasses.
|
597
|
+
#
|
598
|
+
# * {PublicSuffix::Rule::Normal}
|
599
|
+
# * {PublicSuffix::Rule::Exception}
|
600
|
+
# * {PublicSuffix::Rule::Wildcard}
|
601
|
+
#
|
602
|
+
# ## Properties
|
603
|
+
#
|
604
|
+
# A rule is composed by 4 properties:
|
605
|
+
#
|
606
|
+
# value - A normalized version of the rule name.
|
607
|
+
# The normalization process depends on rule tpe.
|
608
|
+
#
|
609
|
+
# Here's an example
|
610
|
+
#
|
611
|
+
# PublicSuffix::Rule.factory("*.google.com")
|
612
|
+
# #<PublicSuffix::Rule::Wildcard:0x1015c14b0
|
613
|
+
# @value="google.com"
|
614
|
+
# >
|
615
|
+
#
|
616
|
+
# ## Rule Creation
|
617
|
+
#
|
618
|
+
# The best way to create a new rule is passing the rule name
|
619
|
+
# to the <tt>PublicSuffix::Rule.factory</tt> method.
|
620
|
+
#
|
621
|
+
# PublicSuffix::Rule.factory("com")
|
622
|
+
# # => PublicSuffix::Rule::Normal
|
623
|
+
#
|
624
|
+
# PublicSuffix::Rule.factory("*.com")
|
625
|
+
# # => PublicSuffix::Rule::Wildcard
|
626
|
+
#
|
627
|
+
# This method will detect the rule type and create an instance
|
628
|
+
# from the proper rule class.
|
629
|
+
#
|
630
|
+
# ## Rule Usage
|
631
|
+
#
|
632
|
+
# A rule describes the composition of a domain name and explains how to tokenize
|
633
|
+
# the name into tld, sld and trd.
|
634
|
+
#
|
635
|
+
# To use a rule, you first need to be sure the name you want to tokenize
|
636
|
+
# can be handled by the current rule.
|
637
|
+
# You can use the <tt>#match?</tt> method.
|
638
|
+
#
|
639
|
+
# rule = PublicSuffix::Rule.factory("com")
|
640
|
+
#
|
641
|
+
# rule.match?("google.com")
|
642
|
+
# # => true
|
643
|
+
#
|
644
|
+
# rule.match?("google.com")
|
645
|
+
# # => false
|
646
|
+
#
|
647
|
+
# Rule order is significant. A name can match more than one rule.
|
648
|
+
# See the {Public Suffix Documentation}[http://publicsuffix.org/format/]
|
649
|
+
# to learn more about rule priority.
|
650
|
+
#
|
651
|
+
# When you have the right rule, you can use it to tokenize the domain name.
|
652
|
+
#
|
653
|
+
# rule = PublicSuffix::Rule.factory("com")
|
654
|
+
#
|
655
|
+
# rule.decompose("google.com")
|
656
|
+
# # => ["google", "com"]
|
657
|
+
#
|
658
|
+
# rule.decompose("www.google.com")
|
659
|
+
# # => ["www.google", "com"]
|
660
|
+
#
|
661
|
+
# @abstract
|
662
|
+
#
|
663
|
+
# source://public_suffix//lib/public_suffix/rule.rb#102
|
664
|
+
class PublicSuffix::Rule::Base
|
665
|
+
# Initializes a new rule.
|
666
|
+
#
|
667
|
+
# @param value [String]
|
668
|
+
# @param private [Boolean]
|
669
|
+
# @return [Base] a new instance of Base
|
670
|
+
#
|
671
|
+
# source://public_suffix//lib/public_suffix/rule.rb#126
|
672
|
+
def initialize(value:, length: T.unsafe(nil), private: T.unsafe(nil)); end
|
673
|
+
|
674
|
+
# Checks whether this rule is equal to <tt>other</tt>.
|
675
|
+
#
|
676
|
+
# @param other [PublicSuffix::Rule::*] The rule to compare
|
677
|
+
# @return [Boolean] true if this rule and other are instances of the same class
|
678
|
+
# and has the same value, false otherwise.
|
679
|
+
#
|
680
|
+
# source://public_suffix//lib/public_suffix/rule.rb#137
|
681
|
+
def ==(other); end
|
682
|
+
|
683
|
+
# @abstract
|
684
|
+
# @param domain [#to_s] The domain name to decompose
|
685
|
+
# @raise [NotImplementedError]
|
686
|
+
# @return [Array<String, nil>]
|
687
|
+
#
|
688
|
+
# source://public_suffix//lib/public_suffix/rule.rb#180
|
689
|
+
def decompose(*_arg0); end
|
690
|
+
|
691
|
+
# Checks whether this rule is equal to <tt>other</tt>.
|
692
|
+
#
|
693
|
+
# @param other [PublicSuffix::Rule::*] The rule to compare
|
694
|
+
# @return [Boolean] true if this rule and other are instances of the same class
|
695
|
+
# and has the same value, false otherwise.
|
696
|
+
#
|
697
|
+
# source://public_suffix//lib/public_suffix/rule.rb#137
|
698
|
+
def eql?(other); end
|
699
|
+
|
700
|
+
# @return [String] the length of the rule
|
701
|
+
#
|
702
|
+
# source://public_suffix//lib/public_suffix/rule.rb#108
|
703
|
+
def length; end
|
704
|
+
|
705
|
+
# Checks if this rule matches +name+.
|
706
|
+
#
|
707
|
+
# A domain name is said to match a rule if and only if
|
708
|
+
# all of the following conditions are met:
|
709
|
+
#
|
710
|
+
# - When the domain and rule are split into corresponding labels,
|
711
|
+
# that the domain contains as many or more labels than the rule.
|
712
|
+
# - Beginning with the right-most labels of both the domain and the rule,
|
713
|
+
# and continuing for all labels in the rule, one finds that for every pair,
|
714
|
+
# either they are identical, or that the label from the rule is "*".
|
715
|
+
#
|
716
|
+
# @example
|
717
|
+
# PublicSuffix::Rule.factory("com").match?("example.com")
|
718
|
+
# # => true
|
719
|
+
# PublicSuffix::Rule.factory("com").match?("example.net")
|
720
|
+
# # => false
|
721
|
+
# @param name [String] the domain name to check
|
722
|
+
# @return [Boolean]
|
723
|
+
# @see https://publicsuffix.org/list/
|
724
|
+
#
|
725
|
+
# source://public_suffix//lib/public_suffix/rule.rb#163
|
726
|
+
def match?(name); end
|
727
|
+
|
728
|
+
# @abstract
|
729
|
+
# @raise [NotImplementedError]
|
730
|
+
#
|
731
|
+
# source://public_suffix//lib/public_suffix/rule.rb#173
|
732
|
+
def parts; end
|
733
|
+
|
734
|
+
# @return [Boolean] true if the rule is a private domain
|
735
|
+
#
|
736
|
+
# source://public_suffix//lib/public_suffix/rule.rb#111
|
737
|
+
def private; end
|
738
|
+
|
739
|
+
# @return [String] the rule definition
|
740
|
+
#
|
741
|
+
# source://public_suffix//lib/public_suffix/rule.rb#105
|
742
|
+
def value; end
|
743
|
+
|
744
|
+
class << self
|
745
|
+
# Initializes a new rule from the content.
|
746
|
+
#
|
747
|
+
# @param content [String] the content of the rule
|
748
|
+
# @param private [Boolean]
|
749
|
+
#
|
750
|
+
# source://public_suffix//lib/public_suffix/rule.rb#118
|
751
|
+
def build(content, private: T.unsafe(nil)); end
|
752
|
+
end
|
753
|
+
end
|
754
|
+
|
755
|
+
# @api internal
|
756
|
+
#
|
757
|
+
# source://public_suffix//lib/public_suffix/rule.rb#25
|
758
|
+
class PublicSuffix::Rule::Entry < ::Struct
|
759
|
+
# Returns the value of attribute length
|
760
|
+
#
|
761
|
+
# @return [Object] the current value of length
|
762
|
+
def length; end
|
763
|
+
|
764
|
+
# Sets the attribute length
|
765
|
+
#
|
766
|
+
# @param value [Object] the value to set the attribute length to.
|
767
|
+
# @return [Object] the newly set value
|
768
|
+
#
|
769
|
+
# source://public_suffix//lib/public_suffix/rule.rb#25
|
770
|
+
def length=(_); end
|
771
|
+
|
772
|
+
# Returns the value of attribute private
|
773
|
+
#
|
774
|
+
# @return [Object] the current value of private
|
775
|
+
def private; end
|
776
|
+
|
777
|
+
# Sets the attribute private
|
778
|
+
#
|
779
|
+
# @param value [Object] the value to set the attribute private to.
|
780
|
+
# @return [Object] the newly set value
|
781
|
+
#
|
782
|
+
# source://public_suffix//lib/public_suffix/rule.rb#25
|
783
|
+
def private=(_); end
|
784
|
+
|
785
|
+
# Returns the value of attribute type
|
786
|
+
#
|
787
|
+
# @return [Object] the current value of type
|
788
|
+
def type; end
|
789
|
+
|
790
|
+
# Sets the attribute type
|
791
|
+
#
|
792
|
+
# @param value [Object] the value to set the attribute type to.
|
793
|
+
# @return [Object] the newly set value
|
794
|
+
#
|
795
|
+
# source://public_suffix//lib/public_suffix/rule.rb#25
|
796
|
+
def type=(_); end
|
797
|
+
|
798
|
+
class << self
|
799
|
+
def [](*_arg0); end
|
800
|
+
def inspect; end
|
801
|
+
def members; end
|
802
|
+
def new(*_arg0); end
|
803
|
+
end
|
804
|
+
end
|
805
|
+
|
806
|
+
# Exception represents an exception rule (e.g. !parliament.uk).
|
807
|
+
#
|
808
|
+
# source://public_suffix//lib/public_suffix/rule.rb#265
|
809
|
+
class PublicSuffix::Rule::Exception < ::PublicSuffix::Rule::Base
|
810
|
+
# Decomposes the domain name according to rule properties.
|
811
|
+
#
|
812
|
+
# @param domain [#to_s] The domain name to decompose
|
813
|
+
# @return [Array<String>] The array with [trd + sld, tld].
|
814
|
+
#
|
815
|
+
# source://public_suffix//lib/public_suffix/rule.rb#286
|
816
|
+
def decompose(domain); end
|
817
|
+
|
818
|
+
# dot-split rule value and returns all rule parts
|
819
|
+
# in the order they appear in the value.
|
820
|
+
# The leftmost label is not considered a label.
|
821
|
+
#
|
822
|
+
# See http://publicsuffix.org/format/:
|
823
|
+
# If the prevailing rule is a exception rule,
|
824
|
+
# modify it by removing the leftmost label.
|
825
|
+
#
|
826
|
+
# @return [Array<String>]
|
827
|
+
#
|
828
|
+
# source://public_suffix//lib/public_suffix/rule.rb#301
|
829
|
+
def parts; end
|
830
|
+
|
831
|
+
# Gets the original rule definition.
|
832
|
+
#
|
833
|
+
# @return [String] The rule definition.
|
834
|
+
#
|
835
|
+
# source://public_suffix//lib/public_suffix/rule.rb#278
|
836
|
+
def rule; end
|
837
|
+
|
838
|
+
class << self
|
839
|
+
# Initializes a new rule from the content.
|
840
|
+
#
|
841
|
+
# @param content [#to_s] the content of the rule
|
842
|
+
# @param private [Boolean]
|
843
|
+
#
|
844
|
+
# source://public_suffix//lib/public_suffix/rule.rb#271
|
845
|
+
def build(content, private: T.unsafe(nil)); end
|
846
|
+
end
|
847
|
+
end
|
848
|
+
|
849
|
+
# Normal represents a standard rule (e.g. com).
|
850
|
+
#
|
851
|
+
# source://public_suffix//lib/public_suffix/rule.rb#187
|
852
|
+
class PublicSuffix::Rule::Normal < ::PublicSuffix::Rule::Base
|
853
|
+
# Decomposes the domain name according to rule properties.
|
854
|
+
#
|
855
|
+
# @param domain [#to_s] The domain name to decompose
|
856
|
+
# @return [Array<String>] The array with [trd + sld, tld].
|
857
|
+
#
|
858
|
+
# source://public_suffix//lib/public_suffix/rule.rb#200
|
859
|
+
def decompose(domain); end
|
860
|
+
|
861
|
+
# dot-split rule value and returns all rule parts
|
862
|
+
# in the order they appear in the value.
|
863
|
+
#
|
864
|
+
# @return [Array<String>]
|
865
|
+
#
|
866
|
+
# source://public_suffix//lib/public_suffix/rule.rb#210
|
867
|
+
def parts; end
|
868
|
+
|
869
|
+
# Gets the original rule definition.
|
870
|
+
#
|
871
|
+
# @return [String] The rule definition.
|
872
|
+
#
|
873
|
+
# source://public_suffix//lib/public_suffix/rule.rb#192
|
874
|
+
def rule; end
|
875
|
+
end
|
876
|
+
|
877
|
+
# Wildcard represents a wildcard rule (e.g. *.co.uk).
|
878
|
+
#
|
879
|
+
# source://public_suffix//lib/public_suffix/rule.rb#217
|
880
|
+
class PublicSuffix::Rule::Wildcard < ::PublicSuffix::Rule::Base
|
881
|
+
# Initializes a new rule.
|
882
|
+
#
|
883
|
+
# @param value [String]
|
884
|
+
# @param length [Integer]
|
885
|
+
# @param private [Boolean]
|
886
|
+
# @return [Wildcard] a new instance of Wildcard
|
887
|
+
#
|
888
|
+
# source://public_suffix//lib/public_suffix/rule.rb#232
|
889
|
+
def initialize(value:, length: T.unsafe(nil), private: T.unsafe(nil)); end
|
890
|
+
|
891
|
+
# Decomposes the domain name according to rule properties.
|
892
|
+
#
|
893
|
+
# @param domain [#to_s] The domain name to decompose
|
894
|
+
# @return [Array<String>] The array with [trd + sld, tld].
|
895
|
+
#
|
896
|
+
# source://public_suffix//lib/public_suffix/rule.rb#248
|
897
|
+
def decompose(domain); end
|
898
|
+
|
899
|
+
# dot-split rule value and returns all rule parts
|
900
|
+
# in the order they appear in the value.
|
901
|
+
#
|
902
|
+
# @return [Array<String>]
|
903
|
+
#
|
904
|
+
# source://public_suffix//lib/public_suffix/rule.rb#258
|
905
|
+
def parts; end
|
906
|
+
|
907
|
+
# Gets the original rule definition.
|
908
|
+
#
|
909
|
+
# @return [String] The rule definition.
|
910
|
+
#
|
911
|
+
# source://public_suffix//lib/public_suffix/rule.rb#240
|
912
|
+
def rule; end
|
913
|
+
|
914
|
+
class << self
|
915
|
+
# Initializes a new rule from the content.
|
916
|
+
#
|
917
|
+
# @param content [String] the content of the rule
|
918
|
+
# @param private [Boolean]
|
919
|
+
#
|
920
|
+
# source://public_suffix//lib/public_suffix/rule.rb#223
|
921
|
+
def build(content, private: T.unsafe(nil)); end
|
922
|
+
end
|
923
|
+
end
|
924
|
+
|
925
|
+
# source://public_suffix//lib/public_suffix.rb#27
|
926
|
+
PublicSuffix::STAR = T.let(T.unsafe(nil), String)
|
927
|
+
|
928
|
+
# @return [String] the current library version
|
929
|
+
#
|
930
|
+
# source://public_suffix//lib/public_suffix/version.rb#12
|
931
|
+
PublicSuffix::VERSION = T.let(T.unsafe(nil), String)
|