Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vidibus-uuid

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vidibus-uuid

  • 1.0.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Vidibus::Uuid

Generates and validates compact UUIDs. Basically, this is an abstraction of http://github.com/assaf/uuid

This gem is part of Vidibus, an open source toolset for building distributed (video) applications.

Installation

Add gem "vidibus-uuid" to your Gemfile. Then call bundle install on your console.

Usage

Vidibus::Uuid.generate
# => "b063263064e0012d47b658b035f038ab"

Vidibus::Uuid.validate("b063263064e0012d47b658b035f038ab")
# => true

Usage in Mongoid model

Include the Vidibus::Uuid::Mongoid module in your Mongoid model:

class MyModel
  include Mongoid::Document
  include Vidibus::Uuid::Mongoid
end

Validation of custom attributes

To verfify that custom attributes are formatted as UUID, add the uuid validator to your model:

class MyModel
  include Mongoid::Document
  field :product_uuid
  validates :product_uuid, :uuid => {:allow_blank => true}
end

© 2010-2012 Andre Pankratz. See LICENSE for details.

FAQs

Package last updated on 23 Oct 2012

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc