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