Sha256: 92cc00832982fc0e2cdc7278f56c92febf049d1ecabcf7a80baf4a9a1a9c825d

Contents?: true

Size: 937 Bytes

Versions: 19

Compression:

Stored size: 937 Bytes

Contents

require 'date'

module Phrase
  class CustomMetadataDataType
    BOOLEAN = "boolean".freeze
    DATE = "date".freeze
    LINK = "link".freeze
    MULTI_SELECT = "multi_select".freeze
    NUMBER = "number".freeze
    SINGLE_SELECT = "single_select".freeze
    STRING = "string".freeze
    TEXT = "text".freeze

    # Builds the enum from string
    # @param [String] The enum value in the form of the string
    # @return [String] The enum value
    def self.build_from_hash(value)
      new.build_from_hash(value)
    end

    # Builds the enum from string
    # @param [String] The enum value in the form of the string
    # @return [String] The enum value
    def build_from_hash(value)
      constantValues = CustomMetadataDataType.constants.select { |c| CustomMetadataDataType::const_get(c) == value }
      raise "Invalid ENUM value #{value} for class #CustomMetadataDataType" if constantValues.empty?
      value
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
phrase-3.7.1 lib/phrase/models/custom_metadata_data_type.rb
phrase-3.7.0 lib/phrase/models/custom_metadata_data_type.rb
phrase-3.6.0 lib/phrase/models/custom_metadata_data_type.rb
phrase-3.5.0 lib/phrase/models/custom_metadata_data_type.rb
phrase-3.4.0 lib/phrase/models/custom_metadata_data_type.rb
phrase-3.3.0 lib/phrase/models/custom_metadata_data_type.rb
phrase-3.2.1 lib/phrase/models/custom_metadata_data_type.rb
phrase-3.2.0 lib/phrase/models/custom_metadata_data_type.rb
phrase-3.1.1 lib/phrase/models/custom_metadata_data_type.rb
phrase-3.1.0 lib/phrase/models/custom_metadata_data_type.rb
phrase-3.0.0 lib/phrase/models/custom_metadata_data_type.rb
phrase-2.26.0 lib/phrase/models/custom_metadata_data_type.rb
phrase-2.25.0 lib/phrase/models/custom_metadata_data_type.rb
phrase-2.24.0 lib/phrase/models/custom_metadata_data_type.rb
phrase-2.23.0 lib/phrase/models/custom_metadata_data_type.rb
phrase-2.22.2 lib/phrase/models/custom_metadata_data_type.rb
phrase-2.22.1 lib/phrase/models/custom_metadata_data_type.rb
phrase-2.22.0 lib/phrase/models/custom_metadata_data_type.rb
phrase-2.21.0 lib/phrase/models/custom_metadata_data_type.rb