clean-architecture 2.0.0 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (118) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rspec.yml +21 -0
  3. data/.gitignore +1 -0
  4. data/.ruby-version +1 -1
  5. data/CHANGELOG.md +42 -0
  6. data/Gemfile +1 -0
  7. data/README.md +423 -4
  8. data/clean-architecture.gemspec +9 -5
  9. data/generate_require_files.rb +1 -0
  10. data/lib/clean-architecture.rb +1 -0
  11. data/lib/clean_architecture/adapters/all.rb +1 -0
  12. data/lib/clean_architecture/adapters/attribute_hash_base.rb +1 -0
  13. data/lib/clean_architecture/all.rb +3 -0
  14. data/lib/clean_architecture/builders/abstract_active_record_entity_builder.rb +124 -0
  15. data/lib/clean_architecture/builders/all.rb +6 -0
  16. data/lib/clean_architecture/checks/all.rb +1 -0
  17. data/lib/clean_architecture/checks/authorization.rb +1 -0
  18. data/lib/clean_architecture/entities/all.rb +1 -0
  19. data/lib/clean_architecture/entities/failure_details.rb +2 -1
  20. data/lib/clean_architecture/entities/targeted_parameters.rb +1 -0
  21. data/lib/clean_architecture/entities/untargeted_parameters.rb +1 -0
  22. data/lib/clean_architecture/interfaces/all.rb +1 -0
  23. data/lib/clean_architecture/interfaces/authorization_parameters.rb +1 -0
  24. data/lib/clean_architecture/interfaces/base_parameters.rb +1 -0
  25. data/lib/clean_architecture/interfaces/jsonable.rb +1 -0
  26. data/lib/clean_architecture/interfaces/success_payload.rb +1 -0
  27. data/lib/clean_architecture/interfaces/targeted_parameters.rb +1 -0
  28. data/lib/clean_architecture/interfaces/use_case.rb +1 -0
  29. data/lib/clean_architecture/interfaces/use_case_actor.rb +1 -0
  30. data/lib/clean_architecture/interfaces/use_case_target.rb +1 -0
  31. data/lib/clean_architecture/matchers/all.rb +1 -0
  32. data/lib/clean_architecture/matchers/use_case_result.rb +1 -0
  33. data/lib/clean_architecture/queries/all.rb +1 -0
  34. data/lib/clean_architecture/queries/http_failure_code.rb +1 -0
  35. data/lib/clean_architecture/queries/http_success_code.rb +1 -0
  36. data/lib/clean_architecture/serializers/all.rb +1 -0
  37. data/lib/clean_architecture/serializers/html_response_from_result.rb +1 -0
  38. data/lib/clean_architecture/serializers/json_response_from_result.rb +1 -0
  39. data/lib/clean_architecture/serializers/success_collection_payload.rb +1 -0
  40. data/lib/clean_architecture/serializers/success_payload.rb +1 -0
  41. data/lib/clean_architecture/types.rb +2 -1
  42. data/lib/clean_architecture/use_cases/abstract_use_case.rb +62 -0
  43. data/lib/clean_architecture/use_cases/all.rb +10 -0
  44. data/lib/clean_architecture/use_cases/contract.rb +9 -0
  45. data/lib/clean_architecture/use_cases/errors.rb +57 -0
  46. data/lib/clean_architecture/use_cases/form.rb +116 -0
  47. data/lib/clean_architecture/use_cases/parameters.rb +42 -0
  48. data/lib/clean_architecture/version.rb +2 -1
  49. data/sorbet/config +2 -0
  50. data/sorbet/rbi/gems/activemodel.rbi +74 -0
  51. data/sorbet/rbi/gems/activesupport.rbi +440 -0
  52. data/sorbet/rbi/gems/ast.rbi +47 -0
  53. data/sorbet/rbi/gems/axiom-types.rbi +159 -0
  54. data/sorbet/rbi/gems/byebug.rbi +1039 -0
  55. data/sorbet/rbi/gems/codeclimate-engine-rb.rbi +123 -0
  56. data/sorbet/rbi/gems/coderay.rbi +91 -0
  57. data/sorbet/rbi/gems/coercible.rbi +156 -0
  58. data/sorbet/rbi/gems/concurrent-ruby.rbi +1587 -0
  59. data/sorbet/rbi/gems/descendants_tracker.rbi +17 -0
  60. data/sorbet/rbi/gems/docile.rbi +31 -0
  61. data/sorbet/rbi/gems/dry-configurable.rbi +89 -0
  62. data/sorbet/rbi/gems/dry-container.rbi +88 -0
  63. data/sorbet/rbi/gems/dry-core.rbi +79 -0
  64. data/sorbet/rbi/gems/dry-equalizer.rbi +25 -0
  65. data/sorbet/rbi/gems/dry-inflector.rbi +72 -0
  66. data/sorbet/rbi/gems/dry-initializer.rbi +209 -0
  67. data/sorbet/rbi/gems/dry-logic.rbi +304 -0
  68. data/sorbet/rbi/gems/dry-matcher.rbi +33 -0
  69. data/sorbet/rbi/gems/dry-monads.rbi +508 -0
  70. data/sorbet/rbi/gems/dry-schema.rbi +790 -0
  71. data/sorbet/rbi/gems/dry-struct.rbi +165 -0
  72. data/sorbet/rbi/gems/dry-types.rbi +688 -0
  73. data/sorbet/rbi/gems/dry-validation.rbi +284 -0
  74. data/sorbet/rbi/gems/duckface-interfaces.rbi +93 -0
  75. data/sorbet/rbi/gems/equalizer.rbi +22 -0
  76. data/sorbet/rbi/gems/i18n.rbi +132 -0
  77. data/sorbet/rbi/gems/ice_nine.rbi +66 -0
  78. data/sorbet/rbi/gems/jaro_winkler.rbi +14 -0
  79. data/sorbet/rbi/gems/kwalify.rbi +339 -0
  80. data/sorbet/rbi/gems/method_source.rbi +63 -0
  81. data/sorbet/rbi/gems/parallel.rbi +81 -0
  82. data/sorbet/rbi/gems/parser.rbi +1293 -0
  83. data/sorbet/rbi/gems/pry-byebug.rbi +149 -0
  84. data/sorbet/rbi/gems/pry.rbi +1964 -0
  85. data/sorbet/rbi/gems/psych.rbi +462 -0
  86. data/sorbet/rbi/gems/rainbow.rbi +117 -0
  87. data/sorbet/rbi/gems/rake.rbi +634 -0
  88. data/sorbet/rbi/gems/rb-readline.rbi +766 -0
  89. data/sorbet/rbi/gems/reek.rbi +1066 -0
  90. data/sorbet/rbi/gems/rspec-core.rbi +1658 -0
  91. data/sorbet/rbi/gems/rspec-expectations.rbi +430 -0
  92. data/sorbet/rbi/gems/rspec-mocks.rbi +815 -0
  93. data/sorbet/rbi/gems/rspec-support.rbi +268 -0
  94. data/sorbet/rbi/gems/rspec.rbi +14 -0
  95. data/sorbet/rbi/gems/rubocop-rspec.rbi +875 -0
  96. data/sorbet/rbi/gems/rubocop.rbi +7014 -0
  97. data/sorbet/rbi/gems/ruby-progressbar.rbi +304 -0
  98. data/sorbet/rbi/gems/simplecov-html.rbi +30 -0
  99. data/sorbet/rbi/gems/simplecov.rbi +225 -0
  100. data/sorbet/rbi/gems/stackprof.rbi +51 -0
  101. data/sorbet/rbi/gems/thread_safe.rbi +81 -0
  102. data/sorbet/rbi/gems/timecop.rbi +97 -0
  103. data/sorbet/rbi/gems/unicode-display_width.rbi +16 -0
  104. data/sorbet/rbi/gems/virtus.rbi +421 -0
  105. data/sorbet/rbi/hidden-definitions/errors.txt +7332 -0
  106. data/sorbet/rbi/hidden-definitions/hidden.rbi +17521 -0
  107. data/sorbet/rbi/sorbet-typed/lib/activemodel/all/activemodel.rbi +422 -0
  108. data/sorbet/rbi/sorbet-typed/lib/activesupport/>=6.0.0.rc1/activesupport.rbi +23 -0
  109. data/sorbet/rbi/sorbet-typed/lib/activesupport/all/activesupport.rbi +625 -0
  110. data/sorbet/rbi/sorbet-typed/lib/bundler/all/bundler.rbi +8684 -0
  111. data/sorbet/rbi/sorbet-typed/lib/minitest/all/minitest.rbi +99 -0
  112. data/sorbet/rbi/sorbet-typed/lib/rainbow/all/rainbow.rbi +254 -0
  113. data/sorbet/rbi/sorbet-typed/lib/ruby/all/gem.rbi +4222 -0
  114. data/sorbet/rbi/sorbet-typed/lib/ruby/all/open3.rbi +111 -0
  115. data/sorbet/rbi/sorbet-typed/lib/ruby/all/resolv.rbi +543 -0
  116. data/sorbet/rbi/todo.rbi +12 -0
  117. metadata +156 -24
  118. data/Gemfile.lock +0 -187
@@ -0,0 +1,9 @@
1
+ # typed: strong
2
+ # frozen_string_literal: true
3
+
4
+ module CleanArchitecture
5
+ module UseCases
6
+ class Contract < Dry::Validation::Contract
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,57 @@
1
+ # typed: true
2
+ # frozen_string_literal: true
3
+
4
+ require 'active_model'
5
+ require 'active_support/core_ext/string/inflections'
6
+
7
+ module CleanArchitecture
8
+ module UseCases
9
+ # Acts as a facade in front of ActiveModel::Errors implementing the bare minimum of the API
10
+ # It also implements the same interface as a FailureDetails so as to be interchangeable if
11
+ # passed back to code expecting a FailureDetails
12
+ class Errors
13
+ extend Forwardable
14
+ include ActiveModel::Translation
15
+
16
+ DEFAULT_FAILURE_DETAILS_TYPE = 'error'
17
+
18
+ def initialize(base, type = DEFAULT_FAILURE_DETAILS_TYPE)
19
+ @active_model_errors = ActiveModel::Errors.new(base)
20
+ @type = type
21
+ end
22
+
23
+ attr_reader :type
24
+
25
+ def message
26
+ full_messages.join(', ')
27
+ end
28
+
29
+ def other_properties
30
+ {}
31
+ end
32
+
33
+ def_delegators :@active_model_errors,
34
+ :count,
35
+ :each,
36
+ :size,
37
+ :clear,
38
+ :blank?,
39
+ :empty?,
40
+ :add
41
+
42
+ ATTRIBUTE_NAME_HUMANIZE_OPTIONS = { capitalize: true, keep_id_suffix: false }
43
+ BASE_NAME = :base
44
+
45
+ def full_messages
46
+ @active_model_errors.messages.map do |attribute, messages|
47
+ attribute_name = if attribute == BASE_NAME
48
+ nil
49
+ else
50
+ ActiveSupport::Inflector.humanize(attribute, ATTRIBUTE_NAME_HUMANIZE_OPTIONS)
51
+ end
52
+ messages.map { |message| [attribute_name, message].compact.join(' ') }
53
+ end.flatten
54
+ end
55
+ end
56
+ end
57
+ end
@@ -0,0 +1,116 @@
1
+ # typed: false
2
+ # frozen_string_literal: true
3
+
4
+ require 'active_model'
5
+ require 'clean_architecture/use_cases/errors'
6
+ require 'clean_architecture/entities/failure_details'
7
+ require 'dry/struct'
8
+ require 'dry/monads/try'
9
+ require 'dry/matcher/result_matcher'
10
+
11
+ module CleanArchitecture
12
+ module UseCases
13
+ class Form
14
+ include ActiveModel::Conversion
15
+ include Dry::Monads::Try::Mixin
16
+ extend ActiveModel::Naming
17
+
18
+ attr_reader :errors, :context
19
+
20
+ def initialize(params: {}, context: {}, errors: UseCases::Errors.new(nil))
21
+ @params = params.to_h.symbolize_keys
22
+ @context = context
23
+ @errors = errors
24
+ end
25
+
26
+ def persisted?
27
+ false
28
+ end
29
+
30
+ # Attempts to create the parameter object returning a Dry::Monads::Result with either
31
+ # the parameter object or an exception
32
+ def to_parameter_object
33
+ @to_parameter_object ||= begin
34
+ use_case_class.parameters(parameter_object_hash.merge(context: context))
35
+ end
36
+ end
37
+
38
+ def with_errors(new_errors, override_params: nil)
39
+ self.class.new(
40
+ params: override_params || @params,
41
+ context: @context,
42
+ errors: ErrorsFactory.new(new_errors).manufacture
43
+ )
44
+ end
45
+
46
+ def with_error_message(message, override_params: nil)
47
+ new_errors = UseCases::Errors.new(nil)
48
+ new_errors.add(:base, message)
49
+ with_errors(new_errors, override_params: override_params)
50
+ end
51
+
52
+ def self.acts_as_form_for(use_case_class)
53
+ attribute_names = use_case_class.contract.__schema__.rules.keys
54
+
55
+ attribute_names.each do |attribute_name|
56
+ define_method attribute_name do
57
+ to_parameter_object[attribute_name]
58
+ end
59
+ end
60
+
61
+ define_method :use_case_class do
62
+ use_case_class
63
+ end
64
+ end
65
+
66
+ def self.prepopulate_with(_object, _context)
67
+ raise NotImplementedError, 'This form does not support prepopulation'
68
+ end
69
+
70
+ private
71
+
72
+ def attempt_parameter_object_hash_creation
73
+ errors.clear
74
+ parameter_object_hash
75
+ end
76
+
77
+ # This can be overridden for forms where the params don't map perfectly
78
+ # to the parameter object
79
+ def parameter_object_hash
80
+ @params
81
+ end
82
+
83
+ class ErrorsFactory
84
+ def initialize(errors)
85
+ @errors = errors
86
+ end
87
+
88
+ def manufacture
89
+ if @errors.is_a?(UseCases::Errors)
90
+ return @errors
91
+ elsif @errors.is_a?(Entities::FailureDetails)
92
+ return errors_from_failure_details
93
+ elsif @errors.is_a?(String)
94
+ return errors_from_string
95
+ end
96
+
97
+ raise ArgumentError, "Unable to handle errors of type: #{@errors.class}"
98
+ end
99
+
100
+ private
101
+
102
+ def errors_from_failure_details
103
+ errors = UseCases::Errors.new(nil)
104
+ errors.add(:base, @errors.message)
105
+ errors
106
+ end
107
+
108
+ def errors_from_string
109
+ errors = UseCases::Errors.new(nil)
110
+ errors.add(:base, @errors)
111
+ errors
112
+ end
113
+ end
114
+ end
115
+ end
116
+ end
@@ -0,0 +1,42 @@
1
+ # typed: true
2
+ # frozen_string_literal: true
3
+
4
+ require 'dry/monads/result'
5
+ require 'clean_architecture/use_cases/errors'
6
+
7
+ module CleanArchitecture
8
+ module UseCases
9
+ class Parameters
10
+ include Dry::Monads::Result::Mixin
11
+ extend Forwardable
12
+
13
+ def initialize(context, dry_validation_result)
14
+ @context = context
15
+ @dry_validation_result = dry_validation_result
16
+ end
17
+
18
+ def context(key)
19
+ @context.fetch(key)
20
+ end
21
+
22
+ def_delegators :@dry_validation_result,
23
+ :[]
24
+
25
+ def to_monad
26
+ @dry_validation_result.success? ? Success(@dry_validation_result.to_h) : Failure(errors)
27
+ end
28
+
29
+ INVALID_PARAMS_FAILURE_TYPE = 'expectation_failed'
30
+
31
+ def errors
32
+ new_errors = Errors.new(nil, INVALID_PARAMS_FAILURE_TYPE)
33
+ @dry_validation_result.errors.to_h.each_pair do |invalid_attribute_key, error_messages|
34
+ error_messages.each do |error_message|
35
+ new_errors.add(invalid_attribute_key, error_message)
36
+ end
37
+ end
38
+ new_errors
39
+ end
40
+ end
41
+ end
42
+ end
@@ -1,5 +1,6 @@
1
+ # typed: strong
1
2
  # frozen_string_literal: true
2
3
 
3
4
  module CleanArchitecture
4
- VERSION = '2.0.0'
5
+ VERSION = '3.0.0'
5
6
  end
data/sorbet/config ADDED
@@ -0,0 +1,2 @@
1
+ --dir
2
+ .
@@ -0,0 +1,74 @@
1
+ # This file is autogenerated. Do not edit it by hand. Regenerate it with:
2
+ # srb rbi gems
3
+
4
+ # typed: strong
5
+ #
6
+ # If you would like to make changes to this file, great! Please create the gem's shim here:
7
+ #
8
+ # https://github.com/sorbet/sorbet-typed/new/master?filename=lib/activemodel/all/activemodel.rbi
9
+ #
10
+ # activemodel-6.0.0
11
+ module ActiveModel
12
+ def self.eager_load!; end
13
+ def self.gem_version; end
14
+ def self.version; end
15
+ extend ActiveSupport::Autoload
16
+ end
17
+ module ActiveModel::VERSION
18
+ end
19
+ module ActiveModel::Serializers
20
+ extend ActiveSupport::Autoload
21
+ end
22
+ class ActiveModel::Name
23
+ def !~(*args, &block); end
24
+ def <=>(*args, &block); end
25
+ def ==(arg); end
26
+ def ===(arg); end
27
+ def =~(*args, &block); end
28
+ def _singularize(string); end
29
+ def as_json(*args, &block); end
30
+ def cache_key; end
31
+ def collection; end
32
+ def element; end
33
+ def eql?(*args, &block); end
34
+ def human(options = nil); end
35
+ def i18n_key; end
36
+ def initialize(klass, namespace = nil, name = nil); end
37
+ def match?(*args, &block); end
38
+ def name; end
39
+ def param_key; end
40
+ def plural; end
41
+ def route_key; end
42
+ def singular; end
43
+ def singular_route_key; end
44
+ def to_s(*args, &block); end
45
+ def to_str(*args, &block); end
46
+ include Comparable
47
+ end
48
+ module ActiveModel::Naming
49
+ def model_name; end
50
+ def self.extended(base); end
51
+ def self.model_name_from_record_or_class(record_or_class); end
52
+ def self.param_key(record_or_class); end
53
+ def self.plural(record_or_class); end
54
+ def self.route_key(record_or_class); end
55
+ def self.singular(record_or_class); end
56
+ def self.singular_route_key(record_or_class); end
57
+ def self.uncountable?(record_or_class); end
58
+ end
59
+ module ActiveModel::Translation
60
+ def human_attribute_name(attribute, options = nil); end
61
+ def i18n_scope; end
62
+ def lookup_ancestors; end
63
+ include ActiveModel::Naming
64
+ end
65
+ module ActiveModel::Conversion
66
+ def to_key; end
67
+ def to_model; end
68
+ def to_param; end
69
+ def to_partial_path; end
70
+ extend ActiveSupport::Concern
71
+ end
72
+ module ActiveModel::Conversion::ClassMethods
73
+ def _to_partial_path; end
74
+ end
@@ -0,0 +1,440 @@
1
+ # This file is autogenerated. Do not edit it by hand. Regenerate it with:
2
+ # srb rbi gems
3
+
4
+ # typed: true
5
+ #
6
+ # If you would like to make changes to this file, great! Please create the gem's shim here:
7
+ #
8
+ # https://github.com/sorbet/sorbet-typed/new/master?filename=lib/activesupport/all/activesupport.rbi
9
+ #
10
+ # activesupport-6.0.0
11
+ class Hash
12
+ def blank?; end
13
+ def deep_merge!(other_hash, &block); end
14
+ def deep_merge(other_hash, &block); end
15
+ def except!(*keys); end
16
+ def except(*keys); end
17
+ def extract!(*keys); end
18
+ def extractable_options?; end
19
+ def slice!(*keys); end
20
+ end
21
+ module ActiveSupport
22
+ def self.eager_load!; end
23
+ def self.gem_version; end
24
+ def self.test_order; end
25
+ def self.test_order=(obj); end
26
+ def self.to_time_preserves_timezone; end
27
+ def self.to_time_preserves_timezone=(value); end
28
+ def self.version; end
29
+ def test_order; end
30
+ def test_order=(obj); end
31
+ extend ActiveSupport::Autoload
32
+ extend ActiveSupport::LazyLoadHooks
33
+ end
34
+ module ActiveSupport::LazyLoadHooks
35
+ def execute_hook(name, base, options, block); end
36
+ def on_load(name, options = nil, &block); end
37
+ def run_load_hooks(name, base = nil); end
38
+ def self.extended(base); end
39
+ def with_execution_control(name, block, once); end
40
+ end
41
+ module Kernel
42
+ def class_eval(*args, &block); end
43
+ end
44
+ class Module
45
+ def cattr_accessor(*syms, instance_reader: nil, instance_writer: nil, instance_accessor: nil, default: nil, &blk); end
46
+ def cattr_reader(*syms, instance_reader: nil, instance_accessor: nil, default: nil); end
47
+ def cattr_writer(*syms, instance_writer: nil, instance_accessor: nil, default: nil); end
48
+ def delegate(*methods, to: nil, prefix: nil, allow_nil: nil, private: nil); end
49
+ def delegate_missing_to(target); end
50
+ def deprecate(*method_names); end
51
+ def mattr_accessor(*syms, instance_reader: nil, instance_writer: nil, instance_accessor: nil, default: nil, &blk); end
52
+ def mattr_reader(*syms, instance_reader: nil, instance_accessor: nil, default: nil); end
53
+ def mattr_writer(*syms, instance_writer: nil, instance_accessor: nil, default: nil); end
54
+ def method_visibility(method); end
55
+ def module_parent; end
56
+ def module_parent_name; end
57
+ def module_parents; end
58
+ def parent; end
59
+ def parent_name; end
60
+ def parents; end
61
+ def redefine_method(method, &block); end
62
+ def redefine_singleton_method(method, &block); end
63
+ def silence_redefinition_of_method(method); end
64
+ end
65
+ class Module::DelegationError < NoMethodError
66
+ end
67
+ class ActiveSupport::Deprecation
68
+ def self.allocate; end
69
+ def self.behavior(*args, &block); end
70
+ def self.behavior=(arg); end
71
+ def self.debug(*args, &block); end
72
+ def self.debug=(arg); end
73
+ def self.deprecate_methods(*args, &block); end
74
+ def self.deprecation_horizon(*args, &block); end
75
+ def self.deprecation_horizon=(arg); end
76
+ def self.deprecation_warning(deprecated_method_name, message = nil, caller_backtrace = nil); end
77
+ def self.gem_name(*args, &block); end
78
+ def self.gem_name=(arg); end
79
+ def self.initialize(*args, &block); end
80
+ def self.instance; end
81
+ def self.new(*arg0); end
82
+ def self.silence(*args, &block); end
83
+ def self.silenced(*args, &block); end
84
+ def self.silenced=(arg); end
85
+ def self.warn(message = nil, callstack = nil); end
86
+ extend ActiveSupport::Deprecation::InstanceDelegator::ClassMethods
87
+ extend Singleton::SingletonClassMethods
88
+ include ActiveSupport::Deprecation::Behavior
89
+ include ActiveSupport::Deprecation::InstanceDelegator
90
+ include ActiveSupport::Deprecation::MethodWrapper
91
+ include ActiveSupport::Deprecation::Reporting
92
+ include Singleton
93
+ end
94
+ module ActiveSupport::Deprecation::InstanceDelegator
95
+ def self.included(base); end
96
+ end
97
+ module ActiveSupport::Deprecation::InstanceDelegator::ClassMethods
98
+ def include(included_module); end
99
+ def method_added(method_name); end
100
+ end
101
+ module ActiveSupport::Deprecation::InstanceDelegator::OverrideDelegators
102
+ def deprecation_warning(deprecated_method_name, message = nil, caller_backtrace = nil); end
103
+ def warn(message = nil, callstack = nil); end
104
+ end
105
+ module ActiveSupport::Notifications
106
+ def self.instrument(name, payload = nil); end
107
+ def self.instrumenter; end
108
+ def self.notifier; end
109
+ def self.notifier=(arg0); end
110
+ def self.publish(name, *args); end
111
+ def self.subscribe(*args, &block); end
112
+ def self.subscribed(callback, *args, &block); end
113
+ def self.unsubscribe(subscriber_or_name); end
114
+ end
115
+ class ActiveSupport::Notifications::Instrumenter
116
+ def finish(name, payload); end
117
+ def finish_with_state(listeners_state, name, payload); end
118
+ def id; end
119
+ def initialize(notifier); end
120
+ def instrument(name, payload = nil); end
121
+ def start(name, payload); end
122
+ def unique_id; end
123
+ end
124
+ class ActiveSupport::Notifications::Event
125
+ def <<(event); end
126
+ def allocations; end
127
+ def children; end
128
+ def cpu_time; end
129
+ def duration; end
130
+ def end; end
131
+ def end=(ending); end
132
+ def finish!; end
133
+ def idle_time; end
134
+ def initialize(name, start, ending, transaction_id, payload); end
135
+ def name; end
136
+ def now; end
137
+ def now_allocations; end
138
+ def now_cpu; end
139
+ def parent_of?(event); end
140
+ def payload; end
141
+ def self.clock_gettime_supported?; end
142
+ def start!; end
143
+ def time; end
144
+ def transaction_id; end
145
+ end
146
+ class ActiveSupport::Notifications::Fanout
147
+ def finish(name, id, payload, listeners = nil); end
148
+ def initialize; end
149
+ def listeners_for(name); end
150
+ def listening?(name); end
151
+ def lock; end
152
+ def locked?; end
153
+ def publish(name, *args); end
154
+ def start(name, id, payload); end
155
+ def subscribe(pattern = nil, callable = nil, &block); end
156
+ def synchronize(&block); end
157
+ def try_lock; end
158
+ def unlock; end
159
+ def unsubscribe(subscriber_or_name); end
160
+ def wait; end
161
+ include Mutex_m
162
+ end
163
+ module ActiveSupport::Notifications::Fanout::Subscribers
164
+ def self.event_object_subscriber(pattern, block); end
165
+ def self.new(pattern, listener); end
166
+ def self.wrap_all(pattern, subscriber); end
167
+ end
168
+ class ActiveSupport::Notifications::Fanout::Subscribers::Matcher
169
+ def ===(name); end
170
+ def exclusions; end
171
+ def initialize(pattern); end
172
+ def pattern; end
173
+ def self.wrap(pattern); end
174
+ def unsubscribe!(name); end
175
+ end
176
+ class ActiveSupport::Notifications::Fanout::Subscribers::Evented
177
+ def finish(name, id, payload); end
178
+ def initialize(pattern, delegate); end
179
+ def matches?(name); end
180
+ def pattern; end
181
+ def publish(name, *args); end
182
+ def start(name, id, payload); end
183
+ def subscribed_to?(name); end
184
+ def unsubscribe!(name); end
185
+ end
186
+ class ActiveSupport::Notifications::Fanout::Subscribers::Timed < ActiveSupport::Notifications::Fanout::Subscribers::Evented
187
+ def finish(name, id, payload); end
188
+ def publish(name, *args); end
189
+ def start(name, id, payload); end
190
+ end
191
+ class ActiveSupport::Notifications::Fanout::Subscribers::EventObject < ActiveSupport::Notifications::Fanout::Subscribers::Evented
192
+ def build_event(name, id, payload); end
193
+ def finish(name, id, payload); end
194
+ def start(name, id, payload); end
195
+ end
196
+ class ActiveSupport::Notifications::Fanout::Subscribers::AllMessages
197
+ def finish(name, id, payload); end
198
+ def initialize(delegate); end
199
+ def matches?(arg0); end
200
+ def publish(name, *args); end
201
+ def start(name, id, payload); end
202
+ def subscribed_to?(name); end
203
+ def unsubscribe!(*arg0); end
204
+ end
205
+ module ActiveSupport::PerThreadRegistry
206
+ def instance; end
207
+ def method_missing(name, *args, &block); end
208
+ def self.extended(object); end
209
+ end
210
+ class ActiveSupport::Notifications::InstrumentationRegistry
211
+ def initialize; end
212
+ def instrumenter_for(notifier); end
213
+ extend ActiveSupport::PerThreadRegistry
214
+ end
215
+ class ActiveSupport::DeprecationException < StandardError
216
+ end
217
+ module ActiveSupport::Deprecation::Behavior
218
+ def arity_coerce(behavior); end
219
+ def behavior; end
220
+ def behavior=(behavior); end
221
+ def debug; end
222
+ def debug=(arg0); end
223
+ end
224
+ module ActiveSupport::Deprecation::Reporting
225
+ def _extract_callstack(callstack); end
226
+ def deprecated_method_warning(method_name, message = nil); end
227
+ def deprecation_caller_message(callstack); end
228
+ def deprecation_message(callstack, message = nil); end
229
+ def deprecation_warning(deprecated_method_name, message = nil, caller_backtrace = nil); end
230
+ def extract_callstack(callstack); end
231
+ def gem_name; end
232
+ def gem_name=(arg0); end
233
+ def ignored_callstack(path); end
234
+ def silence; end
235
+ def silenced; end
236
+ def silenced=(arg0); end
237
+ def warn(message = nil, callstack = nil); end
238
+ end
239
+ module ActiveSupport::Deprecation::DeprecatedConstantAccessor
240
+ def self.included(base); end
241
+ end
242
+ class Array
243
+ def blank?; end
244
+ def extract_options!; end
245
+ end
246
+ module ActiveSupport::Deprecation::MethodWrapper
247
+ def deprecate_methods(target_module, *method_names); end
248
+ end
249
+ class ActiveSupport::Deprecation::DeprecationProxy
250
+ def inspect; end
251
+ def method_missing(called, *args, &block); end
252
+ def self.new(*args, &block); end
253
+ end
254
+ class ActiveSupport::Deprecation::DeprecatedObjectProxy < ActiveSupport::Deprecation::DeprecationProxy
255
+ def initialize(object, message, deprecator = nil); end
256
+ def target; end
257
+ def warn(callstack, called, args); end
258
+ end
259
+ class ActiveSupport::Deprecation::DeprecatedInstanceVariableProxy < ActiveSupport::Deprecation::DeprecationProxy
260
+ def initialize(instance, method, var = nil, deprecator = nil); end
261
+ def target; end
262
+ def warn(callstack, called, args); end
263
+ end
264
+ class ActiveSupport::Deprecation::DeprecatedConstantProxy < Module
265
+ def class; end
266
+ def const_missing(name); end
267
+ def initialize(old_const, new_const, deprecator = nil, message: nil); end
268
+ def inspect; end
269
+ def method_missing(called, *args, &block); end
270
+ def self.new(*args, &block); end
271
+ def target; end
272
+ end
273
+ module ActiveSupport::Inflector
274
+ def apply_inflections(word, rules, locale = nil); end
275
+ def camelize(term, uppercase_first_letter = nil); end
276
+ def classify(table_name); end
277
+ def const_regexp(camel_cased_word); end
278
+ def constantize(camel_cased_word); end
279
+ def dasherize(underscored_word); end
280
+ def deconstantize(path); end
281
+ def demodulize(path); end
282
+ def foreign_key(class_name, separate_class_name_and_id_with_underscore = nil); end
283
+ def humanize(lower_case_and_underscored_word, capitalize: nil, keep_id_suffix: nil); end
284
+ def inflections(locale = nil); end
285
+ def ordinal(number); end
286
+ def ordinalize(number); end
287
+ def parameterize(string, separator: nil, preserve_case: nil, locale: nil); end
288
+ def pluralize(word, locale = nil); end
289
+ def safe_constantize(camel_cased_word); end
290
+ def singularize(word, locale = nil); end
291
+ def tableize(class_name); end
292
+ def titleize(word, keep_id_suffix: nil); end
293
+ def transliterate(string, replacement = nil, locale: nil); end
294
+ def underscore(camel_cased_word); end
295
+ def upcase_first(string); end
296
+ extend ActiveSupport::Inflector
297
+ extend ActiveSupport::Inflector
298
+ end
299
+ class ActiveSupport::Inflector::Inflections
300
+ def acronym(word); end
301
+ def acronyms; end
302
+ def acronyms_camelize_regex; end
303
+ def acronyms_underscore_regex; end
304
+ def clear(scope = nil); end
305
+ def define_acronym_regex_patterns; end
306
+ def human(rule, replacement); end
307
+ def humans; end
308
+ def initialize; end
309
+ def initialize_dup(orig); end
310
+ def irregular(singular, plural); end
311
+ def plural(rule, replacement); end
312
+ def plurals; end
313
+ def self.instance(locale = nil); end
314
+ def singular(rule, replacement); end
315
+ def singulars; end
316
+ def uncountable(*words); end
317
+ def uncountables; end
318
+ end
319
+ class ActiveSupport::Inflector::Inflections::Uncountables < Array
320
+ def <<(*word); end
321
+ def add(words); end
322
+ def delete(entry); end
323
+ def initialize; end
324
+ def to_regex(string); end
325
+ def uncountable?(str); end
326
+ end
327
+ module ActiveSupport::Autoload
328
+ def autoload(const_name, path = nil); end
329
+ def autoload_at(path); end
330
+ def autoload_under(path); end
331
+ def autoloads; end
332
+ def eager_autoload; end
333
+ def eager_load!; end
334
+ def self.extended(base); end
335
+ end
336
+ module ActiveSupport::VERSION
337
+ end
338
+ module ActiveSupport::Concern
339
+ def append_features(base); end
340
+ def class_methods(&class_methods_module_definition); end
341
+ def included(base = nil, &block); end
342
+ def self.extended(base); end
343
+ end
344
+ class ActiveSupport::Concern::MultipleIncludedBlocks < StandardError
345
+ def initialize; end
346
+ end
347
+ module ActiveSupport::LoggerThreadSafeLevel
348
+ def add(severity, message = nil, progname = nil, &block); end
349
+ def after_initialize; end
350
+ def debug?; end
351
+ def error?; end
352
+ def fatal?; end
353
+ def info?; end
354
+ def level; end
355
+ def local_level; end
356
+ def local_level=(level); end
357
+ def local_log_id; end
358
+ def unknown?; end
359
+ def warn?; end
360
+ extend ActiveSupport::Concern
361
+ end
362
+ module LoggerSilence
363
+ extend ActiveSupport::Concern
364
+ end
365
+ module ActiveSupport::LoggerSilence
366
+ def silence(temporary_level = nil); end
367
+ extend ActiveSupport::Concern
368
+ end
369
+ class ActiveSupport::Logger < Logger
370
+ def initialize(*args); end
371
+ def self.broadcast(logger); end
372
+ def self.local_levels; end
373
+ def self.local_levels=(obj); end
374
+ def self.logger_outputs_to?(logger, *sources); end
375
+ def self.silencer; end
376
+ def self.silencer=(obj); end
377
+ def silencer; end
378
+ def silencer=(obj); end
379
+ include ActiveSupport::LoggerSilence
380
+ include ActiveSupport::LoggerThreadSafeLevel
381
+ end
382
+ class ActiveSupport::Logger::SimpleFormatter < Logger::Formatter
383
+ def call(severity, timestamp, progname, msg); end
384
+ end
385
+ module DateAndTime
386
+ end
387
+ module DateAndTime::Compatibility
388
+ def preserve_timezone; end
389
+ def self.preserve_timezone; end
390
+ def self.preserve_timezone=(obj); end
391
+ end
392
+ class Object < BasicObject
393
+ def blank?; end
394
+ def presence; end
395
+ def present?; end
396
+ end
397
+ class NilClass
398
+ def blank?; end
399
+ end
400
+ class FalseClass
401
+ def blank?; end
402
+ end
403
+ class TrueClass
404
+ def blank?; end
405
+ end
406
+ class String
407
+ def camelcase(first_letter = nil); end
408
+ def camelize(first_letter = nil); end
409
+ def classify; end
410
+ def constantize; end
411
+ def dasherize; end
412
+ def deconstantize; end
413
+ def demodulize; end
414
+ def foreign_key(separate_class_name_and_id_with_underscore = nil); end
415
+ def humanize(capitalize: nil, keep_id_suffix: nil); end
416
+ def is_utf8?; end
417
+ def mb_chars; end
418
+ def parameterize(separator: nil, preserve_case: nil, locale: nil); end
419
+ def pluralize(count = nil, locale = nil); end
420
+ def safe_constantize; end
421
+ def singularize(locale = nil); end
422
+ def tableize; end
423
+ def titlecase(keep_id_suffix: nil); end
424
+ def titleize(keep_id_suffix: nil); end
425
+ def underscore; end
426
+ def upcase_first; end
427
+ end
428
+ class Numeric
429
+ def blank?; end
430
+ end
431
+ class Time
432
+ def blank?; end
433
+ end
434
+ class Class < Module
435
+ def class_attribute(*attrs, instance_accessor: nil, instance_reader: nil, instance_writer: nil, instance_predicate: nil, default: nil); end
436
+ end
437
+ module ActiveSupport::Multibyte
438
+ def self.proxy_class; end
439
+ def self.proxy_class=(klass); end
440
+ end