legal_entity 0.1.0.pre.beta0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.rubocop.yml +18 -0
- data/CHANGELOG.md +5 -0
- data/MIT-LICENSE +21 -0
- data/README.md +1 -0
- data/Rakefile +10 -0
- data/legal_entity.gemspec +45 -0
- data/lib/legal_entity/person.rb +7 -0
- data/lib/legal_entity/version.rb +6 -0
- data/lib/legal_entity.rb +9 -0
- data/sorbet/config +4 -0
- data/sorbet/rbi/annotations/.gitattributes +1 -0
- data/sorbet/rbi/annotations/activemodel.rbi +89 -0
- data/sorbet/rbi/annotations/activerecord.rbi +92 -0
- data/sorbet/rbi/annotations/activesupport.rbi +421 -0
- data/sorbet/rbi/annotations/rainbow.rbi +269 -0
- data/sorbet/rbi/gems/.gitattributes +1 -0
- data/sorbet/rbi/gems/activemodel@7.0.5.rbi +6022 -0
- data/sorbet/rbi/gems/activerecord@7.0.5.rbi +37827 -0
- data/sorbet/rbi/gems/activesupport@7.0.5.rbi +18125 -0
- data/sorbet/rbi/gems/ast@2.4.2.rbi +584 -0
- data/sorbet/rbi/gems/concurrent-ruby@1.2.3.rbi +11590 -0
- data/sorbet/rbi/gems/erubi@1.12.0.rbi +145 -0
- data/sorbet/rbi/gems/i18n@1.14.1.rbi +2325 -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/minitest@5.22.2.rbi +1535 -0
- data/sorbet/rbi/gems/netrc@0.11.0.rbi +158 -0
- data/sorbet/rbi/gems/parallel@1.24.0.rbi +280 -0
- data/sorbet/rbi/gems/parser@3.3.0.5.rbi +5472 -0
- data/sorbet/rbi/gems/prettier_print@1.2.1.rbi +951 -0
- data/sorbet/rbi/gems/prism@0.24.0.rbi +31040 -0
- data/sorbet/rbi/gems/racc@1.7.3.rbi +161 -0
- data/sorbet/rbi/gems/rainbow@3.1.1.rbi +402 -0
- data/sorbet/rbi/gems/rake@13.1.0.rbi +3132 -0
- data/sorbet/rbi/gems/rbi@0.1.9.rbi +3006 -0
- data/sorbet/rbi/gems/regexp_parser@2.9.0.rbi +3771 -0
- data/sorbet/rbi/gems/rexml@3.2.6.rbi +4781 -0
- data/sorbet/rbi/gems/rubocop-ast@1.30.0.rbi +7141 -0
- data/sorbet/rbi/gems/rubocop-minitest@0.34.5.rbi +2576 -0
- data/sorbet/rbi/gems/rubocop-rake@0.6.0.rbi +328 -0
- data/sorbet/rbi/gems/rubocop-sorbet@0.7.4.rbi +1442 -0
- data/sorbet/rbi/gems/rubocop@1.60.2.rbi +57372 -0
- data/sorbet/rbi/gems/ruby-progressbar@1.13.0.rbi +1317 -0
- data/sorbet/rbi/gems/spoom@1.2.4.rbi +3777 -0
- data/sorbet/rbi/gems/syntax_tree@6.2.0.rbi +23136 -0
- data/sorbet/rbi/gems/tapioca@0.12.0.rbi +3508 -0
- data/sorbet/rbi/gems/thor@1.3.0.rbi +4345 -0
- data/sorbet/rbi/gems/tzinfo@2.0.6.rbi +5917 -0
- data/sorbet/rbi/gems/unicode-display_width@2.5.0.rbi +65 -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 +256 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 56e30bcc7f0afcd1b4c4a9f0b94edd5738ea506da9c0c16cb96988f11076ed5c
|
4
|
+
data.tar.gz: 454e46089d5147fa331c90bcb086f5d1d3483a9c82913f1ced73e473a441735c
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 6246bbd815072b35a248cdc6bb5b1fb19178838e0e980659881cd12d2433d0b3f417120270e7576d47e981ea60ea345723d703e7672f9a4c325a0608072ee892
|
7
|
+
data.tar.gz: b97fe82f471b67f7c5d9ae19da3de5741c8bdb805e88e00728d3310cb6ff1e4c71ba5c12859126fa3d56acdfc28b3f75b7304c88b3c8d4da113e8714b45d27b8
|
data/.rubocop.yml
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
require:
|
2
|
+
- rubocop-rake
|
3
|
+
- rubocop-minitest
|
4
|
+
- rubocop-sorbet
|
5
|
+
|
6
|
+
AllCops:
|
7
|
+
TargetRubyVersion: 2.7
|
8
|
+
|
9
|
+
Style/StringLiterals:
|
10
|
+
Enabled: true
|
11
|
+
EnforcedStyle: double_quotes
|
12
|
+
|
13
|
+
Style/StringLiteralsInInterpolation:
|
14
|
+
Enabled: true
|
15
|
+
EnforcedStyle: double_quotes
|
16
|
+
|
17
|
+
Layout/LineLength:
|
18
|
+
Max: 120
|
data/CHANGELOG.md
ADDED
data/MIT-LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2024- Yaw Boakye
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
# LegalEntity
|
data/Rakefile
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "lib/legal_entity/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = "legal_entity"
|
7
|
+
spec.version = LegalEntity::VERSION
|
8
|
+
spec.authors = ["Yaw Boakye"]
|
9
|
+
spec.email = ["wheresyaw@gmail.com"]
|
10
|
+
|
11
|
+
spec.required_ruby_version = ">= 2.7.0"
|
12
|
+
|
13
|
+
spec.summary = %(`legal_entity` represents, in your system, the legally recognized entity, according to some jurisdiction.)
|
14
|
+
spec.description = spec.summary
|
15
|
+
spec.homepage = %(https://github.com/yawboakye/legal_entity)
|
16
|
+
spec.license = "MIT"
|
17
|
+
|
18
|
+
spec.metadata["allowed_push_host"] = "https://rubygems.org"
|
19
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
20
|
+
spec.metadata["source_code_uri"] = spec.homepage
|
21
|
+
spec.metadata["changelog_uri"] = %(#{spec.homepage}/CHANGELOG.md)
|
22
|
+
|
23
|
+
spec.files = Dir.chdir(__dir__) do
|
24
|
+
`git ls-files -z`.split("\x0").reject do |f|
|
25
|
+
(File.expand_path(f) == __FILE__) ||
|
26
|
+
f.start_with?(*%w[bin/ test/ features/ .git .github Gemfile])
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
spec.require_paths = %w[lib]
|
31
|
+
|
32
|
+
spec.add_runtime_dependency "sorbet-runtime", "~> 0.5"
|
33
|
+
|
34
|
+
spec.add_development_dependency "minitest", "~> 5.16"
|
35
|
+
spec.add_development_dependency "rake", "~> 13.0"
|
36
|
+
spec.add_development_dependency "rubocop", "~> 1.21"
|
37
|
+
spec.add_development_dependency "rubocop-minitest", "~> 0.34"
|
38
|
+
spec.add_development_dependency "rubocop-rake", "~> 0.6"
|
39
|
+
spec.add_development_dependency "rubocop-sorbet", "~> 0.7"
|
40
|
+
spec.add_development_dependency "sorbet", "~> 0.5"
|
41
|
+
spec.add_development_dependency "spoom", "~> 1.2"
|
42
|
+
spec.add_development_dependency "tapioca", "~> 0.12"
|
43
|
+
|
44
|
+
spec.add_dependency "activerecord", "~> 7.0"
|
45
|
+
end
|
data/lib/legal_entity.rb
ADDED
data/sorbet/config
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
**/*.rbi linguist-vendored=true
|
@@ -0,0 +1,89 @@
|
|
1
|
+
# typed: true
|
2
|
+
|
3
|
+
# DO NOT EDIT MANUALLY
|
4
|
+
# This file was pulled from a central RBI files repository.
|
5
|
+
# Please run `bin/tapioca annotations` to update it.
|
6
|
+
|
7
|
+
class ActiveModel::Errors
|
8
|
+
Elem = type_member { { fixed: ActiveModel::Error } }
|
9
|
+
|
10
|
+
sig { params(attribute: T.any(Symbol, String)).returns(T::Array[String]) }
|
11
|
+
def [](attribute); end
|
12
|
+
|
13
|
+
sig { params(attribute: T.any(Symbol, String), type: T.untyped, options: T.untyped).returns(ActiveModel::Error) }
|
14
|
+
def add(attribute, type = :invalid, **options); end
|
15
|
+
|
16
|
+
sig { params(attribute: T.any(Symbol, String), type: T.untyped, options: T.untyped).returns(T::Boolean) }
|
17
|
+
def added?(attribute, type = :invalid, options = {}); end
|
18
|
+
|
19
|
+
sig { params(options: T.untyped).returns(T::Hash[T.untyped, T.untyped]) }
|
20
|
+
def as_json(options = nil); end
|
21
|
+
|
22
|
+
sig { returns(T::Array[Symbol]) }
|
23
|
+
def attribute_names; end
|
24
|
+
|
25
|
+
sig { params(attribute: T.any(Symbol, String), type: T.untyped, options: T.untyped).returns(T.nilable(T::Array[String])) }
|
26
|
+
def delete(attribute, type = nil, **options); end
|
27
|
+
|
28
|
+
sig { returns(T::Hash[Symbol, T::Array[T::Hash[Symbol, T.untyped]]]) }
|
29
|
+
def details; end
|
30
|
+
|
31
|
+
sig { returns(T::Array[Elem]) }
|
32
|
+
def errors; end
|
33
|
+
|
34
|
+
sig { params(attribute: T.any(Symbol, String), message: String).returns(String) }
|
35
|
+
def full_message(attribute, message); end
|
36
|
+
|
37
|
+
sig { returns(T::Array[String]) }
|
38
|
+
def full_messages; end
|
39
|
+
|
40
|
+
sig { params(attribute: T.any(Symbol, String)).returns(T::Array[String]) }
|
41
|
+
def full_messages_for(attribute); end
|
42
|
+
|
43
|
+
sig { params(attribute: T.any(Symbol, String), type: T.untyped, options: T.untyped).returns(String) }
|
44
|
+
def generate_message(attribute, type = :invalid, options = {}); end
|
45
|
+
|
46
|
+
sig { returns(T::Hash[Symbol, T::Array[ActiveModel::Error]]) }
|
47
|
+
def group_by_attribute; end
|
48
|
+
|
49
|
+
sig { params(attribute: T.any(Symbol, String)).returns(T::Boolean) }
|
50
|
+
def has_key?(attribute); end
|
51
|
+
|
52
|
+
sig { params(error: ActiveModel::Error, override_options: T.untyped).returns(T::Array[ActiveModel::Error]) }
|
53
|
+
def import(error, override_options = {}); end
|
54
|
+
|
55
|
+
sig { params(attribute: T.any(Symbol, String)).returns(T::Boolean) }
|
56
|
+
def include?(attribute); end
|
57
|
+
|
58
|
+
sig { params(attribute: T.any(Symbol, String)).returns(T::Boolean) }
|
59
|
+
def key?(attribute); end
|
60
|
+
|
61
|
+
sig { params(other: T.untyped).returns(T::Array[ActiveModel::Error]) }
|
62
|
+
def merge!(other); end
|
63
|
+
|
64
|
+
sig { returns(T::Hash[Symbol, T::Array[String]]) }
|
65
|
+
def messages; end
|
66
|
+
|
67
|
+
sig { params(attribute: T.any(Symbol, String)).returns(T::Array[String]) }
|
68
|
+
def messages_for(attribute); end
|
69
|
+
|
70
|
+
sig { returns(T::Array[Elem]) }
|
71
|
+
def objects; end
|
72
|
+
|
73
|
+
sig { params(attribute: T.any(Symbol, String), type: T.untyped).returns(T::Boolean) }
|
74
|
+
def of_kind?(attribute, type = :invalid); end
|
75
|
+
|
76
|
+
sig { returns(T::Array[String]) }
|
77
|
+
def to_a; end
|
78
|
+
|
79
|
+
sig { params(full_messages: T.untyped).returns(T::Hash[Symbol, T::Array[String]]) }
|
80
|
+
def to_hash(full_messages = false); end
|
81
|
+
|
82
|
+
sig { params(attribute: T.any(Symbol, String), type: T.untyped, options: T.untyped).returns(T::Array[ActiveModel::Error]) }
|
83
|
+
def where(attribute, type = nil, **options); end
|
84
|
+
end
|
85
|
+
|
86
|
+
module ActiveModel::Validations
|
87
|
+
sig { returns(ActiveModel::Errors) }
|
88
|
+
def errors; end
|
89
|
+
end
|
@@ -0,0 +1,92 @@
|
|
1
|
+
# typed: true
|
2
|
+
|
3
|
+
# DO NOT EDIT MANUALLY
|
4
|
+
# This file was pulled from a central RBI files repository.
|
5
|
+
# Please run `bin/tapioca annotations` to update it.
|
6
|
+
|
7
|
+
class ActiveRecord::Schema
|
8
|
+
sig { params(info: T::Hash[T.untyped, T.untyped], blk: T.proc.bind(ActiveRecord::Schema).void).void }
|
9
|
+
def self.define(info = nil, &blk); end
|
10
|
+
end
|
11
|
+
|
12
|
+
class ActiveRecord::Migration
|
13
|
+
# @shim: Methods on migration are delegated to `SchemaStatements` using `method_missing`
|
14
|
+
include ActiveRecord::ConnectionAdapters::SchemaStatements
|
15
|
+
|
16
|
+
# @shim: Methods on migration are delegated to `DatabaseStatements` using `method_missing`
|
17
|
+
include ActiveRecord::ConnectionAdapters::DatabaseStatements
|
18
|
+
end
|
19
|
+
|
20
|
+
class ActiveRecord::Base
|
21
|
+
sig { returns(FalseClass) }
|
22
|
+
def blank?; end
|
23
|
+
|
24
|
+
# @shim: since `present?` is always true, `presence` always returns `self`
|
25
|
+
sig { returns(T.self_type) }
|
26
|
+
def presence; end
|
27
|
+
|
28
|
+
sig { returns(TrueClass) }
|
29
|
+
def present?; end
|
30
|
+
|
31
|
+
sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void }
|
32
|
+
def self.after_initialize(*args, **options, &block); end
|
33
|
+
|
34
|
+
sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void }
|
35
|
+
def self.after_find(*args, **options, &block); end
|
36
|
+
|
37
|
+
sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void }
|
38
|
+
def self.after_touch(*args, **options, &block); end
|
39
|
+
|
40
|
+
sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void }
|
41
|
+
def self.before_validation(*args, **options, &block); end
|
42
|
+
|
43
|
+
sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void }
|
44
|
+
def self.after_validation(*args, **options, &block); end
|
45
|
+
|
46
|
+
sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void }
|
47
|
+
def self.before_save(*args, **options, &block); end
|
48
|
+
|
49
|
+
sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void }
|
50
|
+
def self.around_save(*args, **options, &block); end
|
51
|
+
|
52
|
+
sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void }
|
53
|
+
def self.after_save(*args, **options, &block); end
|
54
|
+
|
55
|
+
sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void }
|
56
|
+
def self.before_create(*args, **options, &block); end
|
57
|
+
|
58
|
+
sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void }
|
59
|
+
def self.around_create(*args, **options, &block); end
|
60
|
+
|
61
|
+
sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void }
|
62
|
+
def self.after_create(*args, **options, &block); end
|
63
|
+
|
64
|
+
sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void }
|
65
|
+
def self.before_update(*args, **options, &block); end
|
66
|
+
|
67
|
+
sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void }
|
68
|
+
def self.around_update(*args, **options, &block); end
|
69
|
+
|
70
|
+
sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void }
|
71
|
+
def self.after_update(*args, **options, &block); end
|
72
|
+
|
73
|
+
sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void }
|
74
|
+
def self.before_destroy(*args, **options, &block); end
|
75
|
+
|
76
|
+
sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void }
|
77
|
+
def self.around_destroy(*args, **options, &block); end
|
78
|
+
|
79
|
+
sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void }
|
80
|
+
def self.after_destroy(*args, **options, &block); end
|
81
|
+
|
82
|
+
sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void }
|
83
|
+
def self.after_commit(*args, **options, &block); end
|
84
|
+
|
85
|
+
sig { params(args: T.untyped, options: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).params(record: T.attached_class).void)).void }
|
86
|
+
def self.after_rollback(*args, **options, &block); end
|
87
|
+
end
|
88
|
+
|
89
|
+
class ActiveRecord::Relation
|
90
|
+
sig { returns(T::Boolean) }
|
91
|
+
def blank?; end
|
92
|
+
end
|