Skip to content

[REQUEST] A UUID format #44

@andreionweb

Description

@andreionweb

IMPORTANT: please make sure you ask yourself all intro questions and fill all sections of the template.

Before we start...:

  • I checked the documentation and didn't find this feature
  • I checked to make sure that this feature has not already been requested

Branch/Commit:

v1.1.0

Describe the feature:

Please include a detailed description of the feature you are requesting and any detail on it’s expected behavior.

As a developer
I do use UUID env variables
And I want to use a UUID format

Problem:

Please include a detailed description of the problem this feature would solve.

As a developer
I want to use a UUID format
So that I don't have to set a regex format every time I use a UUID

Mockups:

It should support both compact and default UUID formats:

  # It checks the value to check if it is a UUID or not.
  #
  # @param [String] A string
  # @return [Boolean] True if it is a UUID value. False otherwise.
  def self.uuid?(string)
    string.match?(/\A[\da-f]{32}\z/i) ||
      string.match?(/\A[\da-f]{8}-([\da-f]{4}-){3}[\da-f]{12}\z/i)
  end

Resources:

UUID.validate

I will abide by the code of conduct

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions