Sha256: 20bf1d5107869f32cc52a08a4cd797323c631b187958f385b9b08f65b2b60df0

Contents?: true

Size: 678 Bytes

Versions: 2

Compression:

Stored size: 678 Bytes

Contents

# typed: ignore
# frozen_string_literal: true

require 'schema_dot_org'
require 'schema_dot_org/search_action'

module SchemaDotOrg
  # Model the Schema.org `Thing > CreativeWork > WebSite`.
  # @See http://schema.org/WebSite
  class WebSite < SchemaType
    attr_accessor :name, :url, :potential_action
    validates :name,             type: String, presence: true
    validates :url,              type: String, presence: true
    validates :potential_action, type: SchemaDotOrg::SearchAction, allow_nil: true

    def _to_json_struct
      {
        'name' => name,
        'url' => url,
        'potentialAction' => potential_action&.to_json_struct
      }
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
schema_dot_org-1.7.1 lib/schema_dot_org/web_site.rb
schema_dot_org-1.7.0 lib/schema_dot_org/web_site.rb