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 +4 -4
- data/.ruby-version +1 -1
- data/.travis.yml +1 -0
- data/Gemfile +2 -2
- data/Gemfile.lock +46 -31
- data/README.md +4 -3
- data/Rakefile +3 -3
- data/bin/console +3 -3
- data/lib/schema_dot_org.rb +12 -11
- data/lib/schema_dot_org/organization.rb +9 -9
- data/lib/schema_dot_org/person.rb +2 -3
- data/lib/schema_dot_org/place.rb +2 -2
- data/lib/schema_dot_org/search_action.rb +3 -3
- data/lib/schema_dot_org/web_site.rb +4 -4
- data/run-script +1 -0
- data/schema_dot_org.gemspec +22 -15
- data/sorbet/config +2 -0
- data/sorbet/rbi/gems/activemodel.rbi +262 -0
- data/sorbet/rbi/gems/activesupport.rbi +912 -0
- data/sorbet/rbi/gems/concurrent-ruby.rbi +1590 -0
- data/sorbet/rbi/gems/i18n.rbi +133 -0
- data/sorbet/rbi/gems/rake.rbi +644 -0
- data/sorbet/rbi/gems/rspec-core.rbi +1872 -0
- data/sorbet/rbi/gems/rspec-expectations.rbi +1123 -0
- data/sorbet/rbi/gems/rspec-mocks.rbi +1090 -0
- data/sorbet/rbi/gems/rspec-support.rbi +280 -0
- data/sorbet/rbi/gems/rspec.rbi +15 -0
- data/sorbet/rbi/gems/thread_safe.rbi +82 -0
- data/sorbet/rbi/gems/tzinfo.rbi +408 -0
- data/sorbet/rbi/gems/validated_object.rbi +60 -0
- data/sorbet/rbi/sorbet-typed/lib/activemodel/all/activemodel.rbi +597 -0
- data/sorbet/rbi/sorbet-typed/lib/activesupport/>=6/activesupport.rbi +36 -0
- data/sorbet/rbi/sorbet-typed/lib/activesupport/all/activesupport.rbi +1431 -0
- data/sorbet/rbi/sorbet-typed/lib/minitest/all/minitest.rbi +108 -0
- data/test-script.rb +9 -11
- metadata +62 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 125273e4c13ee100e668d7aad12d40379c51773968c50013fe21845fc2d60cb6
|
4
|
+
data.tar.gz: e27714ef970a5320827c7250e504050c97d58a5d8a2acea7aa589a81797a4729
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7bb7ef8ca7d109793ebec2c79de1931855f7cff07f5751c5d7d6b7bc1a09ac4d431aa254c834f356e968ea4aae3f259765cf33e734701b836f69240cb7da6cb8
|
7
|
+
data.tar.gz: 6894a06c5bad02000c1de3e2d4aa4171c18f76d417d82ce52b783bcb7ee90d315742d1b879b88a3f728515877b704b980b87e25b962bf85b706ee7f958e6344e
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.6.6
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
source
|
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
|
-
|
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 (
|
11
|
-
activesupport (=
|
12
|
-
activesupport (
|
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 (>=
|
15
|
-
minitest (
|
16
|
-
tzinfo (~>
|
17
|
-
|
18
|
-
|
19
|
-
|
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.
|
22
|
-
rake (
|
23
|
-
rspec (3.
|
24
|
-
rspec-core (~> 3.
|
25
|
-
rspec-expectations (~> 3.
|
26
|
-
rspec-mocks (~> 3.
|
27
|
-
rspec-core (3.
|
28
|
-
rspec-support (~> 3.
|
29
|
-
rspec-expectations (3.
|
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.
|
32
|
-
rspec-mocks (3.
|
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.
|
35
|
-
rspec-support (3.
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
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 (~>
|
47
|
-
rake (
|
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
|
-
|
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
|
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
data/bin/console
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
require
|
4
|
-
require
|
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
|
13
|
+
require 'irb'
|
14
14
|
IRB.start(__FILE__)
|
data/lib/schema_dot_org.rb
CHANGED
@@ -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 = {
|
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:
|
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
|
-
{
|
43
|
+
{ '@type' => un_namespaced_classname }.merge(_to_json_struct.compact)
|
47
44
|
end
|
48
45
|
|
49
|
-
|
50
46
|
def _to_json_struct
|
51
|
-
raise
|
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
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
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' =>
|
14
|
+
'name' => name
|
16
15
|
}
|
17
16
|
end
|
18
17
|
end
|
data/lib/schema_dot_org/place.rb
CHANGED
@@ -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' =>
|
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' =>
|
16
|
-
'
|
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' =>
|
19
|
-
'url' =>
|
20
|
-
'potentialAction' =>
|
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
data/schema_dot_org.gemspec
CHANGED
@@ -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.
|
7
|
-
spec.
|
8
|
-
spec.
|
9
|
-
spec.
|
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 =
|
12
|
-
spec.description =
|
13
|
-
|
14
|
-
spec.
|
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 =
|
23
|
+
spec.bindir = 'exe'
|
20
24
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
21
|
-
spec.require_paths = [
|
25
|
+
spec.require_paths = ['lib']
|
26
|
+
|
27
|
+
spec.add_dependency 'validated_object', '~> 2.1'
|
22
28
|
|
23
|
-
spec.
|
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.
|
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,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
|