Sha256: a285acc8e4bcf627229acf1316ceac096eebaa61f18e09ab5ce019980a050c07

Contents?: true

Size: 616 Bytes

Versions: 2

Compression:

Stored size: 616 Bytes

Contents

# frozen_string_literal: true


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' => self.name,
        'url' =>  self.url,
        'potentialAction' => object_to_json_struct(potential_action)
      }
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
schema_dot_org-2.1 lib/schema_dot_org/web_site.rb
schema_dot_org-2.0 lib/schema_dot_org/web_site.rb