schema_dot_org 1.5.1 → 1.7.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9039661fa215dd59b1b15d4bb22bee6ae739ac5c030f5fe9a27942e1dd635ee2
4
- data.tar.gz: dda30e0482e5b6433ac6f44a526a0f0d0e6105864542b415c44ecbc0a9bca22b
3
+ metadata.gz: 125273e4c13ee100e668d7aad12d40379c51773968c50013fe21845fc2d60cb6
4
+ data.tar.gz: e27714ef970a5320827c7250e504050c97d58a5d8a2acea7aa589a81797a4729
5
5
  SHA512:
6
- metadata.gz: 7180f16b57736871d59b252ab724016638ac0c2bf9f760aa13781a20cf2d46f11913c6ae5ba9ea4b976049876c8be5cc583aae7b974e88ba4ff70e4ad0671cca
7
- data.tar.gz: 2d000cf439ddfdd7635249ee75a7a9dc7b6c812f51ae901a75853ef90a6e659907de93e6a9b0320718ff7c9ca06c93a949ad52b9660d1c7c695f555f9690df8e
6
+ metadata.gz: 7bb7ef8ca7d109793ebec2c79de1931855f7cff07f5751c5d7d6b7bc1a09ac4d431aa254c834f356e968ea4aae3f259765cf33e734701b836f69240cb7da6cb8
7
+ data.tar.gz: 6894a06c5bad02000c1de3e2d4aa4171c18f76d417d82ce52b783bcb7ee90d315742d1b879b88a3f728515877b704b980b87e25b962bf85b706ee7f958e6344e
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.5.1
1
+ 2.6.6
data/.travis.yml CHANGED
@@ -3,4 +3,5 @@ language: ruby
3
3
  rvm:
4
4
  - 2.4.0
5
5
  - 2.5.1
6
+ - 2.6.6
6
7
  before_install: gem install bundler -v 1.16.1
data/Gemfile CHANGED
@@ -1,6 +1,6 @@
1
- source "https://rubygems.org"
1
+ source 'https://rubygems.org'
2
2
 
3
- git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
3
+ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
4
4
 
5
5
  # Specify your gem's dependencies in schema_dot_org.gemspec
6
6
  gemspec
data/Gemfile.lock CHANGED
@@ -1,52 +1,67 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- schema_dot_org (1.5.1)
5
- validated_object (~> 2.0.2)
4
+ schema_dot_org (1.7.0)
5
+ sorbet-runtime (>= 0.5.5890)
6
+ validated_object (~> 2.1)
6
7
 
7
8
  GEM
8
9
  remote: https://rubygems.org/
9
10
  specs:
10
- activemodel (5.2.0)
11
- activesupport (= 5.2.0)
12
- activesupport (5.2.0)
11
+ activemodel (6.1.4)
12
+ activesupport (= 6.1.4)
13
+ activesupport (6.1.4)
13
14
  concurrent-ruby (~> 1.0, >= 1.0.2)
14
- i18n (>= 0.7, < 2)
15
- minitest (~> 5.1)
16
- tzinfo (~> 1.1)
17
- concurrent-ruby (1.0.5)
18
- diff-lcs (1.3)
19
- i18n (1.0.1)
15
+ i18n (>= 1.6, < 2)
16
+ minitest (>= 5.1)
17
+ tzinfo (~> 2.0)
18
+ zeitwerk (~> 2.3)
19
+ concurrent-ruby (1.1.9)
20
+ diff-lcs (1.4.4)
21
+ i18n (1.8.10)
20
22
  concurrent-ruby (~> 1.0)
21
- minitest (5.11.3)
22
- rake (10.5.0)
23
- rspec (3.7.0)
24
- rspec-core (~> 3.7.0)
25
- rspec-expectations (~> 3.7.0)
26
- rspec-mocks (~> 3.7.0)
27
- rspec-core (3.7.1)
28
- rspec-support (~> 3.7.0)
29
- rspec-expectations (3.7.0)
23
+ minitest (5.14.4)
24
+ rake (13.0.5)
25
+ rspec (3.10.0)
26
+ rspec-core (~> 3.10.0)
27
+ rspec-expectations (~> 3.10.0)
28
+ rspec-mocks (~> 3.10.0)
29
+ rspec-core (3.10.1)
30
+ rspec-support (~> 3.10.0)
31
+ rspec-expectations (3.10.1)
30
32
  diff-lcs (>= 1.2.0, < 2.0)
31
- rspec-support (~> 3.7.0)
32
- rspec-mocks (3.7.0)
33
+ rspec-support (~> 3.10.0)
34
+ rspec-mocks (3.10.2)
33
35
  diff-lcs (>= 1.2.0, < 2.0)
34
- rspec-support (~> 3.7.0)
35
- rspec-support (3.7.1)
36
- thread_safe (0.3.6)
37
- tzinfo (1.2.5)
38
- thread_safe (~> 0.1)
39
- validated_object (2.0.2)
36
+ rspec-support (~> 3.10.0)
37
+ rspec-support (3.10.2)
38
+ sorbet (0.5.6485)
39
+ sorbet-static (= 0.5.6485)
40
+ sorbet-runtime (0.5.6485)
41
+ sorbet-static (0.5.6485-universal-darwin-14)
42
+ sorbet-static (0.5.6485-universal-darwin-15)
43
+ sorbet-static (0.5.6485-universal-darwin-16)
44
+ sorbet-static (0.5.6485-universal-darwin-17)
45
+ sorbet-static (0.5.6485-universal-darwin-18)
46
+ sorbet-static (0.5.6485-universal-darwin-19)
47
+ sorbet-static (0.5.6485-universal-darwin-20)
48
+ sorbet-static (0.5.6485-x86_64-linux)
49
+ tzinfo (2.0.4)
50
+ concurrent-ruby (~> 1.0)
51
+ validated_object (2.1.0)
40
52
  activemodel (>= 3.2.21)
53
+ sorbet-runtime (>= 0.5.5890)
54
+ zeitwerk (2.4.2)
41
55
 
42
56
  PLATFORMS
43
57
  ruby
44
58
 
45
59
  DEPENDENCIES
46
- bundler (~> 1.16)
47
- rake (~> 10.0)
60
+ bundler (~> 2)
61
+ rake (>= 12.3.3)
48
62
  rspec (~> 3.0)
49
63
  schema_dot_org!
64
+ sorbet (>= 0.5.5890)
50
65
 
51
66
  BUNDLED WITH
52
- 1.16.1
67
+ 2.2.15
data/README.md CHANGED
@@ -56,7 +56,8 @@ Let's say you have a Rails app. If you put this in a controller:
56
56
  "sameAs": [
57
57
  "https://twitter.com/law_is_code",
58
58
  "https://www.facebook.com/PublicDotLaw"
59
- ],
59
+ ]
60
+ }
60
61
  </script>
61
62
  ```
62
63
 
@@ -159,8 +160,8 @@ To install this gem onto your local machine, run `bundle exec rake install`.
159
160
 
160
161
  ## Contributing
161
162
 
162
- Bug reports and pull requests are welcome on GitHub at https://github.com/dogweather/schema_dot_org.
163
+ Bug reports and pull requests are welcome on GitHub.
163
164
 
164
165
  ## License
165
166
 
166
- The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
167
+ [The](The) gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
data/Rakefile CHANGED
@@ -1,6 +1,6 @@
1
- require "bundler/gem_tasks"
2
- require "rspec/core/rake_task"
1
+ require 'bundler/gem_tasks'
2
+ require 'rspec/core/rake_task'
3
3
 
4
4
  RSpec::Core::RakeTask.new(:spec)
5
5
 
6
- task :default => :spec
6
+ task default: :spec
data/bin/console CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require "bundler/setup"
4
- require "schema_dot_org"
3
+ require 'bundler/setup'
4
+ require 'schema_dot_org'
5
5
 
6
6
  # You can add fixtures and/or initialization code here to make experimenting
7
7
  # with your gem easier. You can also use a different console, if you like.
@@ -10,5 +10,5 @@ require "schema_dot_org"
10
10
  # require "pry"
11
11
  # Pry.start
12
12
 
13
- require "irb"
13
+ require 'irb'
14
14
  IRB.start(__FILE__)
@@ -1,3 +1,4 @@
1
+ # typed: ignore
1
2
  # frozen_string_literal: true
2
3
 
3
4
  require 'json'
@@ -8,12 +9,11 @@ module SchemaDotOrg
8
9
  # Base class for schema types. Refactors out common code.
9
10
  #
10
11
  class SchemaType < ValidatedObject::Base
11
- ROOT_ATTR = { "@context" => "http://schema.org" }.freeze
12
- UNQUALIFIED_CLASS_NAME_REGEX = /([^:]+)$/
13
-
12
+ ROOT_ATTR = { '@context' => 'http://schema.org' }.freeze
13
+ UNQUALIFIED_CLASS_NAME_REGEX = /([^:]+)$/.freeze
14
14
 
15
15
  def to_s
16
- json_string = to_json_ld(pretty: true)
16
+ json_string = to_json_ld(pretty: (!rails_production? && !ENV['SCHEMA_DOT_ORG_MINIFIED_JSON']))
17
17
 
18
18
  # Mark as safe if we're in Rails
19
19
  if json_string.respond_to?(:html_safe)
@@ -23,12 +23,10 @@ module SchemaDotOrg
23
23
  end
24
24
  end
25
25
 
26
-
27
26
  def to_json_ld(pretty: false)
28
27
  "<script type=\"application/ld+json\">\n" + to_json(pretty: pretty, as_root: true) + "\n</script>"
29
28
  end
30
29
 
31
-
32
30
  def to_json(pretty: false, as_root: false)
33
31
  structure = as_root ? ROOT_ATTR.merge(to_json_struct) : to_json_struct
34
32
 
@@ -39,23 +37,26 @@ module SchemaDotOrg
39
37
  end
40
38
  end
41
39
 
42
-
43
40
  # Use the class name to create the "@type" attribute.
44
41
  # @return a hash structure representing json.
45
42
  def to_json_struct
46
- { "@type" => un_namespaced_classname }.merge(_to_json_struct.compact)
43
+ { '@type' => un_namespaced_classname }.merge(_to_json_struct.compact)
47
44
  end
48
45
 
49
-
50
46
  def _to_json_struct
51
- raise "For subclasses to implement"
47
+ raise 'For subclasses to implement'
52
48
  end
53
49
 
54
-
55
50
  # @return the classname without the module namespace.
56
51
  def un_namespaced_classname
57
52
  self.class.name =~ UNQUALIFIED_CLASS_NAME_REGEX
58
53
  Regexp.last_match(1)
59
54
  end
55
+
56
+ private
57
+
58
+ def rails_production?
59
+ defined?(Rails) && Rails.env.production?
60
+ end
60
61
  end
61
62
  end
@@ -1,3 +1,4 @@
1
+ # typed: ignore
1
2
  # frozen_string_literal: true
2
3
 
3
4
  require 'date'
@@ -5,7 +6,6 @@ require 'schema_dot_org'
5
6
  require 'schema_dot_org/person'
6
7
  require 'schema_dot_org/place'
7
8
 
8
-
9
9
  module SchemaDotOrg
10
10
  class Organization < SchemaType
11
11
  attr_accessor :email,
@@ -28,14 +28,14 @@ module SchemaDotOrg
28
28
 
29
29
  def _to_json_struct
30
30
  {
31
- "name" => name,
32
- "email" => email,
33
- "url" => url,
34
- "logo" => logo,
35
- "founder" => founder.to_json_struct,
36
- "foundingDate" => founding_date.to_s,
37
- "foundingLocation" => founding_location.to_json_struct,
38
- "sameAs" => same_as
31
+ 'name' => name,
32
+ 'email' => email,
33
+ 'url' => url,
34
+ 'logo' => logo,
35
+ 'founder' => founder.to_json_struct,
36
+ 'foundingDate' => founding_date.to_s,
37
+ 'foundingLocation' => founding_location.to_json_struct,
38
+ 'sameAs' => same_as
39
39
  }
40
40
  end
41
41
  end
@@ -1,18 +1,17 @@
1
+ # typed: ignore
1
2
  # frozen_string_literal: true
2
3
 
3
4
  require 'schema_dot_org'
4
5
 
5
-
6
6
  module SchemaDotOrg
7
7
  # Model the Schema.org `Person`. See http://schema.org/Person
8
8
  class Person < SchemaType
9
9
  attr_accessor :name
10
10
  validates :name, type: String, presence: true
11
11
 
12
-
13
12
  def _to_json_struct
14
13
  {
15
- 'name' => self.name
14
+ 'name' => name
16
15
  }
17
16
  end
18
17
  end
@@ -1,8 +1,8 @@
1
+ # typed: ignore
1
2
  # frozen_string_literal: true
2
3
 
3
4
  require 'schema_dot_org'
4
5
 
5
-
6
6
  module SchemaDotOrg
7
7
  # Model the Schema.org `Thing > Place`. See http://schema.org/Place
8
8
  class Place < SchemaType
@@ -11,7 +11,7 @@ module SchemaDotOrg
11
11
 
12
12
  def _to_json_struct
13
13
  {
14
- 'address' => self.address
14
+ 'address' => address
15
15
  }
16
16
  end
17
17
  end
@@ -1,8 +1,8 @@
1
+ # typed: ignore
1
2
  # frozen_string_literal: true
2
3
 
3
4
  require 'schema_dot_org'
4
5
 
5
-
6
6
  module SchemaDotOrg
7
7
  # Model the Schema.org `Thing > SearchAction`. See http://schema.org/SearchAction
8
8
  class SearchAction < SchemaType
@@ -12,8 +12,8 @@ module SchemaDotOrg
12
12
 
13
13
  def _to_json_struct
14
14
  {
15
- 'target' => self.target,
16
- 'query_input' => self.query_input
15
+ 'target' => target,
16
+ 'query-input' => query_input ## ! Note the hyphen.
17
17
  }
18
18
  end
19
19
  end
@@ -1,9 +1,9 @@
1
+ # typed: ignore
1
2
  # frozen_string_literal: true
2
3
 
3
4
  require 'schema_dot_org'
4
5
  require 'schema_dot_org/search_action'
5
6
 
6
-
7
7
  module SchemaDotOrg
8
8
  # Model the Schema.org `Thing > CreativeWork > WebSite`.
9
9
  # @See http://schema.org/WebSite
@@ -15,9 +15,9 @@ module SchemaDotOrg
15
15
 
16
16
  def _to_json_struct
17
17
  {
18
- 'name' => self.name,
19
- 'url' => self.url,
20
- 'potentialAction' => self.potential_action&.to_json_struct
18
+ 'name' => name,
19
+ 'url' => url,
20
+ 'potentialAction' => potential_action&.to_json_struct
21
21
  }
22
22
  end
23
23
  end
data/run-script CHANGED
@@ -1 +1,2 @@
1
+ #!/bin/bash
1
2
  ruby -I lib ./test-script.rb
@@ -1,28 +1,35 @@
1
+ # frozen_string_literal: true
2
+
3
+ lib = File.expand_path('lib', __dir__)
1
4
 
2
- lib = File.expand_path("../lib", __FILE__)
3
5
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
6
 
5
7
  Gem::Specification.new do |spec|
6
- spec.name = "schema_dot_org"
7
- spec.version = '1.5.1'
8
- spec.authors = ["Robb Shecter"]
9
- spec.email = ["robb@public.law"]
8
+ spec.required_ruby_version = '>= 2.6'
9
+ spec.name = 'schema_dot_org'
10
+ spec.version = '1.7.1'
11
+ spec.authors = ['Robb Shecter']
12
+ spec.email = ['robb@public.law']
10
13
 
11
- spec.summary = %q{JSON-LD generator for Schema.org vocabulary}
12
- spec.description = %q{Creates well-formed website metadata with strongly typed Ruby.}
13
- spec.homepage = "https://github.com/dogweather/schema-dot-org"
14
- spec.license = "MIT"
14
+ spec.summary = 'JSON-LD generator for Schema.org vocabulary'
15
+ spec.description = 'Creates well-formed website metadata with ' \
16
+ 'strongly typed Ruby.'
17
+ spec.homepage = 'https://github.com/public-law/schema-dot-org'
18
+ spec.license = 'MIT'
15
19
 
16
20
  spec.files = `git ls-files -z`.split("\x0").reject do |f|
17
21
  f.match(%r{^(test|spec|features)/})
18
22
  end
19
- spec.bindir = "exe"
23
+ spec.bindir = 'exe'
20
24
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
21
- spec.require_paths = ["lib"]
25
+ spec.require_paths = ['lib']
26
+
27
+ spec.add_dependency 'validated_object', '~> 2.1'
22
28
 
23
- spec.add_dependency "validated_object", "~> 2.0.2"
29
+ spec.add_development_dependency 'bundler', '~> 2'
30
+ spec.add_development_dependency 'rake', '>= 12.3.3'
31
+ spec.add_development_dependency 'rspec', '~> 3.0'
32
+ spec.add_development_dependency 'sorbet', '>= 0.5.5890'
24
33
 
25
- spec.add_development_dependency "bundler", "~> 1.16"
26
- spec.add_development_dependency "rake", "~> 10.0"
27
- spec.add_development_dependency "rspec", "~> 3.0"
34
+ spec.add_runtime_dependency 'sorbet-runtime', '>= 0.5.5890'
28
35
  end
data/sorbet/config ADDED
@@ -0,0 +1,2 @@
1
+ --dir
2
+ .
@@ -0,0 +1,262 @@
1
+ # This file is autogenerated. Do not edit it by hand. Regenerate it with:
2
+ # srb rbi gems
3
+
4
+ # typed: ignore
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.3.2
11
+
12
+ module ActiveModel
13
+ def self.eager_load!; end
14
+ def self.gem_version; end
15
+ def self.version; end
16
+ extend ActiveSupport::Autoload
17
+ end
18
+ module ActiveModel::VERSION
19
+ end
20
+ module ActiveModel::Serializers
21
+ extend ActiveSupport::Autoload
22
+ end
23
+ module ActiveModel::Validations
24
+ def errors; end
25
+ def initialize_dup(other); end
26
+ def invalid?(context = nil); end
27
+ def raise_validation_error; end
28
+ def read_attribute_for_validation(*arg0); end
29
+ def run_validations!; end
30
+ def valid?(context = nil); end
31
+ def validate!(context = nil); end
32
+ def validate(context = nil); end
33
+ def validates_with(*args, &block); end
34
+ extend ActiveSupport::Concern
35
+ end
36
+ module ActiveModel::Validations::ClassMethods
37
+ def _parse_validates_options(options); end
38
+ def _validates_default_keys; end
39
+ def attribute_method?(attribute); end
40
+ def clear_validators!; end
41
+ def inherited(base); end
42
+ def validate(*args, &block); end
43
+ def validates!(*attributes); end
44
+ def validates(*attributes); end
45
+ def validates_each(*attr_names, &block); end
46
+ def validates_with(*args, &block); end
47
+ def validators; end
48
+ def validators_on(*attributes); end
49
+ end
50
+ module ActiveModel::Validations::Clusivity
51
+ def check_validity!; end
52
+ def delimiter; end
53
+ def include?(record, value); end
54
+ def inclusion_method(enumerable); end
55
+ end
56
+ class ActiveModel::Validator
57
+ def initialize(options = nil); end
58
+ def kind; end
59
+ def options; end
60
+ def self.kind; end
61
+ def validate(record); end
62
+ end
63
+ class ActiveModel::EachValidator < ActiveModel::Validator
64
+ def attributes; end
65
+ def check_validity!; end
66
+ def initialize(options); end
67
+ def validate(record); end
68
+ def validate_each(record, attribute, value); end
69
+ end
70
+ class ActiveModel::BlockValidator < ActiveModel::EachValidator
71
+ def initialize(options, &block); end
72
+ def validate_each(record, attribute, value); end
73
+ end
74
+ class ActiveModel::Validations::InclusionValidator < ActiveModel::EachValidator
75
+ def validate_each(record, attribute, value); end
76
+ include ActiveModel::Validations::Clusivity
77
+ end
78
+ module ActiveModel::Validations::HelperMethods
79
+ def _merge_attributes(attr_names); end
80
+ def validates_absence_of(*attr_names); end
81
+ def validates_acceptance_of(*attr_names); end
82
+ def validates_confirmation_of(*attr_names); end
83
+ def validates_exclusion_of(*attr_names); end
84
+ def validates_format_of(*attr_names); end
85
+ def validates_inclusion_of(*attr_names); end
86
+ def validates_length_of(*attr_names); end
87
+ def validates_numericality_of(*attr_names); end
88
+ def validates_presence_of(*attr_names); end
89
+ def validates_size_of(*attr_names); end
90
+ end
91
+ class ActiveModel::Validations::AbsenceValidator < ActiveModel::EachValidator
92
+ def validate_each(record, attr_name, value); end
93
+ end
94
+ class ActiveModel::Validations::NumericalityValidator < ActiveModel::EachValidator
95
+ def allow_only_integer?(record); end
96
+ def check_validity!; end
97
+ def filtered_options(value); end
98
+ def is_hexadecimal_literal?(raw_value); end
99
+ def is_integer?(raw_value); end
100
+ def is_number?(raw_value); end
101
+ def parse_as_number(raw_value); end
102
+ def record_attribute_changed_in_place?(record, attr_name); end
103
+ def validate_each(record, attr_name, value); end
104
+ end
105
+ module ActiveModel::Validations::Callbacks
106
+ def run_validations!; end
107
+ extend ActiveSupport::Concern
108
+ end
109
+ module ActiveModel::Validations::Callbacks::ClassMethods
110
+ def after_validation(*args, &block); end
111
+ def before_validation(*args, &block); end
112
+ end
113
+ class ActiveModel::Validations::ExclusionValidator < ActiveModel::EachValidator
114
+ def validate_each(record, attribute, value); end
115
+ include ActiveModel::Validations::Clusivity
116
+ end
117
+ class ActiveModel::Validations::ConfirmationValidator < ActiveModel::EachValidator
118
+ def confirmation_value_equal?(record, attribute, value, confirmed); end
119
+ def initialize(options); end
120
+ def setup!(klass); end
121
+ def validate_each(record, attribute, value); end
122
+ end
123
+ class ActiveModel::Validations::FormatValidator < ActiveModel::EachValidator
124
+ def check_options_validity(name); end
125
+ def check_validity!; end
126
+ def option_call(record, name); end
127
+ def record_error(record, attribute, name, value); end
128
+ def regexp_using_multiline_anchors?(regexp); end
129
+ def validate_each(record, attribute, value); end
130
+ end
131
+ class ActiveModel::Validations::PresenceValidator < ActiveModel::EachValidator
132
+ def validate_each(record, attr_name, value); end
133
+ end
134
+ class ActiveModel::Validations::LengthValidator < ActiveModel::EachValidator
135
+ def check_validity!; end
136
+ def initialize(options); end
137
+ def skip_nil_check?(key); end
138
+ def validate_each(record, attribute, value); end
139
+ end
140
+ class ActiveModel::Validations::AcceptanceValidator < ActiveModel::EachValidator
141
+ def acceptable_option?(value); end
142
+ def initialize(options); end
143
+ def setup!(klass); end
144
+ def validate_each(record, attribute, value); end
145
+ end
146
+ class ActiveModel::Validations::AcceptanceValidator::LazilyDefineAttributes < Module
147
+ def ==(other); end
148
+ def attributes; end
149
+ def define_on(klass); end
150
+ def included(klass); end
151
+ def initialize(attributes); end
152
+ def matches?(method_name); end
153
+ end
154
+ class ActiveModel::Validations::WithValidator < ActiveModel::EachValidator
155
+ def validate_each(record, attr, val); end
156
+ end
157
+ class ActiveModel::ValidationError < StandardError
158
+ def initialize(model); end
159
+ def model; end
160
+ end
161
+ class ActiveModel::Name
162
+ def !~(**, &&); end
163
+ def <=>(**, &&); end
164
+ def ==(arg); end
165
+ def ===(arg); end
166
+ def =~(**, &&); end
167
+ def _singularize(string); end
168
+ def as_json(**, &&); end
169
+ def cache_key; end
170
+ def collection; end
171
+ def element; end
172
+ def eql?(**, &&); end
173
+ def human(options = nil); end
174
+ def i18n_key; end
175
+ def initialize(klass, namespace = nil, name = nil); end
176
+ def match?(**, &&); end
177
+ def name; end
178
+ def param_key; end
179
+ def plural; end
180
+ def route_key; end
181
+ def singular; end
182
+ def singular_route_key; end
183
+ def to_s(**, &&); end
184
+ def to_str(**, &&); end
185
+ include Comparable
186
+ end
187
+ module ActiveModel::Naming
188
+ def model_name; end
189
+ def self.extended(base); end
190
+ def self.model_name_from_record_or_class(record_or_class); end
191
+ def self.param_key(record_or_class); end
192
+ def self.plural(record_or_class); end
193
+ def self.route_key(record_or_class); end
194
+ def self.singular(record_or_class); end
195
+ def self.singular_route_key(record_or_class); end
196
+ def self.uncountable?(record_or_class); end
197
+ end
198
+ module ActiveModel::Callbacks
199
+ def _define_after_model_callback(klass, callback); end
200
+ def _define_around_model_callback(klass, callback); end
201
+ def _define_before_model_callback(klass, callback); end
202
+ def define_model_callbacks(*callbacks); end
203
+ def self.extended(base); end
204
+ end
205
+ module ActiveModel::Translation
206
+ def human_attribute_name(attribute, options = nil); end
207
+ def i18n_scope; end
208
+ def lookup_ancestors; end
209
+ include ActiveModel::Naming
210
+ end
211
+ class ActiveModel::Errors
212
+ def [](attribute); end
213
+ def add(attribute, message = nil, options = nil); end
214
+ def added?(attribute, message = nil, options = nil); end
215
+ def apply_default_array(hash); end
216
+ def as_json(options = nil); end
217
+ def blank?; end
218
+ def clear; end
219
+ def copy!(other); end
220
+ def count; end
221
+ def delete(key); end
222
+ def details; end
223
+ def each; end
224
+ def empty?; end
225
+ def full_message(attribute, message); end
226
+ def full_messages; end
227
+ def full_messages_for(attribute); end
228
+ def generate_message(attribute, type = nil, options = nil); end
229
+ def has_key?(attribute); end
230
+ def include?(attribute); end
231
+ def init_with(coder); end
232
+ def initialize(base); end
233
+ def initialize_dup(other); end
234
+ def key?(attribute); end
235
+ def keys; end
236
+ def marshal_dump; end
237
+ def marshal_load(array); end
238
+ def merge!(other); end
239
+ def messages; end
240
+ def normalize_detail(message, options); end
241
+ def normalize_message(attribute, message, options); end
242
+ def of_kind?(attribute, message = nil); end
243
+ def self.i18n_customize_full_message; end
244
+ def self.i18n_customize_full_message=(arg0); end
245
+ def size; end
246
+ def slice!(*keys); end
247
+ def to_a; end
248
+ def to_hash(full_messages = nil); end
249
+ def to_xml(options = nil); end
250
+ def values; end
251
+ def without_default_proc(hash); end
252
+ include Enumerable
253
+ end
254
+ class ActiveModel::StrictValidationFailed < StandardError
255
+ end
256
+ class ActiveModel::RangeError < RangeError
257
+ end
258
+ class ActiveModel::UnknownAttributeError < NoMethodError
259
+ def attribute; end
260
+ def initialize(record, attribute); end
261
+ def record; end
262
+ end