schema_dot_org 2.5.1 → 2.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 51ce5547733a21842002c07e64f087879b748fc0aca5f38be3b1719050b44eb8
4
- data.tar.gz: 847aa9795b17a6903e6a8380ad24e11ae74f14db46225c6bf78965ec585c67a6
3
+ metadata.gz: acd0a2dabb408489cf628e16e4eaee549a84e62cd44493ee9e052707036ed059
4
+ data.tar.gz: a39970f8606e31d91d3a0dc9bba358964d8b8ea368855a347d9466227bb4c0d2
5
5
  SHA512:
6
- metadata.gz: e5b6d909e5edd6999ee5051f1df5b0b8c5f5274172b1f602be3c17e2a5c0fcad9c0499e930e9a757c5c42d62597af4b2e8c89898c534008f63172567113cb53f
7
- data.tar.gz: 04e8ef548d8dcf6dfb2e077fc759a472d29fe0da8a28a28b69b23e79b900daeebaa192d1e55c645dee169381252c20bba14930f2d6f4ecd8a42b93bb127e3aab
6
+ metadata.gz: 394de4b9c3cee09e40c831ee6654c14cf3b73d262c50927e2fb13b1c7e121c7b97f2f740895786ab00ab4ff1d7c01bfd132234bf48149420f81ac365c4749a79
7
+ data.tar.gz: 0aa3cb2bc48156361491d51419659b4504ad8b1016440763ffb8756b4936ca2375fb3f68255c389424ff1534afd39e8336397a894bbb91aff612eb7184330336
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 2.5.2
2
+
3
+ * Improved code comments
4
+
1
5
  ## 2.5.1
2
6
 
3
7
  * New Type: PostalAddress
@@ -1,9 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- #
4
- # Model the Schema.org `Thing > Intangible > Offer > AggregateOffer`. See https://schema.org/Offer
5
- #
3
+
6
4
  module SchemaDotOrg
5
+ ##
6
+ # Model the Schema.org `Thing > Intangible > Offer > AggregateOffer`. See https://schema.org/Offer
7
+ #
7
8
  class AggregateOffer < SchemaType
8
9
  attr_reader :priceCurrency
9
10
 
@@ -1,16 +1,16 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
 
4
- #
5
- # Model the Google / Schema.org `BreadcrumbList`.
6
- #
7
- # The intent is to primarily support Google's BreadcrumbList. Properties
8
- # from Schema.org are welcome if desired.
9
- #
10
- # See https://developers.google.com/search/docs/appearance/structured-data/breadcrumb
11
- # and https://schema.org/BreadcrumbList
12
- #
13
4
  module SchemaDotOrg
5
+ ##
6
+ # Model the Google / Schema.org `BreadcrumbList`.
7
+ #
8
+ # The intent is to primarily support Google's BreadcrumbList. Properties
9
+ # from Schema.org are welcome if desired.
10
+ #
11
+ # See https://developers.google.com/search/docs/appearance/structured-data/breadcrumb
12
+ # and https://schema.org/BreadcrumbList
13
+ #
14
14
  class BreadcrumbList < SchemaType
15
15
  validated_attr :itemListElement, type: Array, presence: true
16
16
  end
@@ -1,10 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
 
4
- #
5
- # https://schema.org/CollegeOrUniversity
6
- #
7
4
  module SchemaDotOrg
5
+ ##
6
+ # https://schema.org/CollegeOrUniversity
7
+ #
8
8
  class CollegeOrUniversity < SchemaType
9
9
  validated_attr :name, type: String, presence: true
10
10
  validated_attr :url, type: String, allow_nil: true
@@ -1,14 +1,13 @@
1
-
2
1
  # frozen_string_literal: true
3
2
 
4
3
  require 'date'
5
4
  require_relative 'person'
6
5
 
7
- #
8
- # Model the Schema.org `Thing > CreativeWork > Comment`.
9
- # See https://schema.org/Comment
10
- #
11
6
  module SchemaDotOrg
7
+ ##
8
+ # Model the Schema.org `Thing > CreativeWork > Comment`.
9
+ # See https://schema.org/Comment
10
+ #
12
11
  class Comment < SchemaType
13
12
  validated_attr :author, type: Person, presence: true
14
13
  validated_attr :datePublished, type: Date, presence: true
@@ -1,10 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
 
4
- #
5
- # Model the Schema.org `ContactPoint`. See http://schema.org/ContactPoint
6
- #
7
4
  module SchemaDotOrg
5
+ ##
6
+ # Model the Schema.org `ContactPoint`. See http://schema.org/ContactPoint
7
+ #
8
8
  class ContactPoint < SchemaType
9
9
  validated_attr :area_served, type: Array, allow_nil: true
10
10
  validated_attr :available_language, type: Array, allow_nil: true
@@ -4,11 +4,11 @@ require 'date'
4
4
  require_relative 'person'
5
5
  require_relative 'organization'
6
6
 
7
- #
8
- # Model the Schema.org `Thing > CreativeWork > Article > SocialMediaPosting > DiscussionForumPosting`.
9
- # See https://schema.org/DiscussionForumPosting
10
- #
11
7
  module SchemaDotOrg
8
+ ##
9
+ # Model the Schema.org `Thing > CreativeWork > Article > SocialMediaPosting > DiscussionForumPosting`.
10
+ # See https://schema.org/DiscussionForumPosting
11
+ #
12
12
  class DiscussionForumPosting < SchemaType
13
13
  validated_attr :author, type: union(Person, Organization), presence: true
14
14
  validated_attr :datePublished, type: union(Date, Time), presence: true
@@ -1,10 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- #
4
- # Model the Schema.org `Thing > Intangible > StructuredValue > InteractionCounter`.
5
- # See https://schema.org/InteractionCounter
6
- #
3
+
7
4
  module SchemaDotOrg
5
+ ##
6
+ # Model the Schema.org `Thing > Intangible > StructuredValue > InteractionCounter`.
7
+ # See https://schema.org/InteractionCounter
8
+ #
8
9
  class InteractionCounter < SchemaType
9
10
  validated_attr :userInteractionCount, type: Integer, presence: true
10
11
  validated_attr :interactionType, type: String, presence: true
@@ -1,10 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
 
4
- #
5
- # Model the Schema.org `ItemList`. See https://schema.org/ItemList
6
- #
7
4
  module SchemaDotOrg
5
+ ##
6
+ # Model the Schema.org `ItemList`. See https://schema.org/ItemList
7
+ #
8
8
  class ItemList < SchemaType
9
9
  validated_attr :itemListElement, type: Array, presence: true
10
10
  validated_attr :itemListOrder, type: String, allow_nil: true
@@ -1,10 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- #
4
- # Model the Schema.org `Thing > Intangible > Language`.
5
- # See https://schema.org/Language
6
- #
3
+
7
4
  module SchemaDotOrg
5
+ ##
6
+ # Model the Schema.org `Thing > Intangible > Language`.
7
+ # See https://schema.org/Language
8
+ #
8
9
  class Language < SchemaType
9
10
  validated_attr :alternateName, type: String, allow_nil: true
10
11
  validated_attr :name, type: String, presence: true
@@ -3,10 +3,10 @@
3
3
 
4
4
  require_relative 'product'
5
5
 
6
- #
7
- # Model the Schema.org `ItemListElement`. See https://schema.org/ItemListElement
8
- #
9
6
  module SchemaDotOrg
7
+ ##
8
+ # Model the Schema.org `ItemListElement`. See https://schema.org/ItemListElement
9
+ #
10
10
  class ListItem < SchemaType
11
11
  validated_attr :image, type: String, allow_nil: true
12
12
  validated_attr :item, type: Object, allow_nil: true # Allow String or SchemaType
@@ -1,10 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
 
4
- #
5
- # Model the Schema.org `Thing > Intangible > Offer`. See https://schema.org/Offer
6
- #
7
4
  module SchemaDotOrg
5
+ ##
6
+ # Model the Schema.org `Thing > Intangible > Offer`. See https://schema.org/Offer
7
+ #
8
8
  class Offer < SchemaType
9
9
  validated_attr :priceCurrency, type: String
10
10
  validated_attr :price, type: Numeric
@@ -6,10 +6,11 @@ require_relative 'person'
6
6
  require_relative 'place'
7
7
  require_relative 'postal_address'
8
8
 
9
- # Google allows `url` to be a string:
10
- # https://developers.google.com/search/docs/appearance/structured-data/logo
11
9
 
12
10
  module SchemaDotOrg
11
+ ##
12
+ # See https://schema.org/Organization
13
+ #
13
14
  class Organization < SchemaType
14
15
  validated_attr :address, type: SchemaDotOrg::PostalAddress, allow_nil: true
15
16
  validated_attr :contact_points, type: Array, allow_nil: true
@@ -23,6 +24,9 @@ module SchemaDotOrg
23
24
  validated_attr :same_as, type: Array, allow_nil: true
24
25
  validated_attr :slogan, type: String, allow_nil: true
25
26
  validated_attr :telephone, type: String, allow_nil: true
27
+
28
+ # Google allows `url` to be a string:
29
+ # https://developers.google.com/search/docs/appearance/structured-data/logo
26
30
  validated_attr :url, type: String
27
31
  end
28
32
  end
@@ -1,10 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
 
4
- #
5
- # Model the Schema.org **Person**. See http://schema.org/Person
6
- #
7
4
  module SchemaDotOrg
5
+ ##
6
+ # Model the Schema.org **Person**. See http://schema.org/Person
7
+ #
8
8
  class Person < SchemaType
9
9
  validated_attr :award, type: String, allow_nil: true
10
10
  validated_attr :alumni_of, type: SchemaDotOrg::CollegeOrUniversity, allow_nil: true
@@ -3,10 +3,10 @@
3
3
  require_relative 'postal_address'
4
4
 
5
5
 
6
- #
7
- # Model the Schema.org `Thing > Place`. See http://schema.org/Place
8
- #
9
6
  module SchemaDotOrg
7
+ ##
8
+ # Model the Schema.org `Thing > Place`. See http://schema.org/Place
9
+ #
10
10
  class Place < SchemaType
11
11
  validated_attr :address, type: union(String, SchemaDotOrg::PostalAddress), presence: true
12
12
  end
@@ -1,10 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- #
4
- # Model the Schema.org `Thing > Intangible > StructuredValue > ContactPoint > PostalAddress`.
5
- # See https://schema.org/PostalAddress
6
- #
3
+
7
4
  module SchemaDotOrg
5
+ ##
6
+ # Model the Schema.org `Thing > Intangible > StructuredValue > ContactPoint > PostalAddress`.
7
+ # See https://schema.org/PostalAddress
8
+ #
8
9
  class PostalAddress < SchemaType
9
10
 
10
11
  # AddressCountry: The country. Recommended to be in 2-letter ISO 3166-1 alpha-2
@@ -1,10 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
 
4
- #
5
- # Model the Schema.org `Thing > Product`. See https://schema.org/Product
6
- #
7
4
  module SchemaDotOrg
5
+ ##
6
+ # Model the Schema.org `Thing > Product`. See https://schema.org/Product
7
+ #
8
8
  class Product < SchemaType
9
9
  validated_attr :description, type: String, allow_nil: true
10
10
  validated_attr :image, type: Array, allow_nil: true
@@ -1,10 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
 
4
- #
5
- # Model the Schema.org `Thing > SearchAction`. See http://schema.org/SearchAction
6
- #
7
4
  module SchemaDotOrg
5
+ ##
6
+ # Model the Schema.org `Thing > SearchAction`. See http://schema.org/SearchAction
7
+ #
8
8
  class SearchAction < SchemaDotOrg::SchemaType
9
9
  validated_attr :query_input, type: String, presence: true
10
10
  validated_attr :target, type: String, presence: true
@@ -1,11 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
 
4
- #
5
- # Model the Schema.org `Thing > CreativeWork > WebSite`.
6
- # @See http://schema.org/WebSite
7
- #
8
4
  module SchemaDotOrg
5
+ ##
6
+ # Model the Schema.org `Thing > CreativeWork > WebSite`.
7
+ # @See http://schema.org/WebSite
8
+ #
9
9
  class WebSite < SchemaType
10
10
  validated_attr :name, type: String, presence: true
11
11
  validated_attr :potential_action, type: SchemaDotOrg::SearchAction, allow_nil: true
@@ -1,8 +1,12 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'json'
3
4
  require 'validated_object'
4
5
 
5
6
 
7
+ ##
8
+ # The main module for the schema-dot-org gem.
9
+ #
6
10
  module SchemaDotOrg
7
11
  ##
8
12
  # Make a BreadcrumbList from an array of links. This is a convenience
@@ -7,7 +7,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
7
7
  Gem::Specification.new do |spec|
8
8
  spec.required_ruby_version = '>= 3.1'
9
9
  spec.name = 'schema_dot_org'
10
- spec.version = '2.5.1'
10
+ spec.version = '2.5.2'
11
11
  spec.authors = ['Robert Shecter']
12
12
  spec.email = ['robert@public.law']
13
13
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: schema_dot_org
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.1
4
+ version: 2.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Shecter