Sha256: c35ceb37c94d4341a2c8330b5a69cf45e1aa971d16ee5d0c4bc7751e2d973f11

Contents?: true

Size: 822 Bytes

Versions: 3

Compression:

Stored size: 822 Bytes

Contents

require 'date'
require 'schema_dot_org'


module SchemaDotOrg
  class Organization < SchemaType
    attr_accessor :email, :founder, :founding_date, :founding_location, :logo, :name, :url

    validates :email,             type: String
    validates :founder,           type: Person
    validates :founding_date,     type: Date
    validates :founding_location, type: Place
    validates :logo,              type: String
    validates :name,              type: String
    validates :url,               type: String

    def _to_json_struct
      {
        "name" => name,
        "email" => email,
        "url" => url,
        "logo" => logo,
        "founder" => founder.to_json_struct,
        "foundingDate" => founding_date.to_s,
        "foundingLocation" => founding_location.to_json_struct
      }
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
schema_dot_org-1.3.0 lib/schema_dot_org/organization.rb
schema_dot_org-1.2.1 lib/schema_dot_org/organization.rb
schema_dot_org-1.2.0 lib/schema_dot_org/organization.rb