Sha256: 3366db2d7205002321fc527d4b5d32fd2b269c3d7bfd005d206ce3dcdc4a3a13

Contents?: true

Size: 946 Bytes

Versions: 2

Compression:

Stored size: 946 Bytes

Contents

# frozen_string_literal: true

require 'schema_dot_org'


module SchemaDotOrg
  # Model the Schema.org `ContactPoint`.  See http://schema.org/ContactPoint
  class ContactPoint < SchemaType
    attr_accessor :telephone,
                  :contact_type,
                  :contact_option,
                  :area_served,
                  :available_language

    validates :telephone,           type: String, presence: true
    validates :contact_type,        type: String, presence: true
    validates :contact_option,      type: String, allow_nil: true
    validates :area_served,         type: Array, allow_nil: true
    validates :available_language,  type: Array, allow_nil: true

    def _to_json_struct
      {
        'telephone' => telephone,
        'contactType' => contact_type,
        'contactOption' => contact_option,
        'areaServed' => area_served,
        'availableLanguage' => available_language
      }
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

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