Sha256: 980541da454ba5a0ce867e15539f6a9d2ff096eab322e35d04bd4a649d051b73

Contents?: true

Size: 619 Bytes

Versions: 3

Compression:

Stored size: 619 Bytes

Contents

# frozen_string_literal: true

require 'extra/enum'

# TODO: подумать над занесением внутрь Project

class INat::Data::Types::ProjectType < Enum

  items :collection,
        :umbrella,
        :contest,
        :bioblitz,
        :assessment,
        :manual

  # TODO: переделать тип во что-то универсальное. наверное.

  class << self

    def parse src
      if src == ''
        return MANUAL
      else
        super src
      end
    end

  end

  def to_s
    if self == MANUAL
      return ''
    else
      super
    end
  end

  freeze
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
inat-get-0.8.0.15 lib/inat/data/enums/projecttype.rb
inat-get-0.8.0.14 lib/inat/data/enums/projecttype.rb
inat-get-0.8.0.13 lib/inat/data/enums/projecttype.rb