bcobb / virtus-uri

Add a URI attribute type to Virtus

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Virtus URI

Provides a URI attribute for Virtus.

Getting Started

  1. Add to your Gemfile
gem 'virtus-uri', require: false
  1. Require it when you'd like to work with URIs:
  require 'virtus'
  require 'virtus/uri'

  class Request
    include Virtus

    attribute :url, URI
  end
  1. Work with URIs:
Request.new(url: 'http://example.com').url == URI('http://example.com')

License

MIT

About

Add a URI attribute type to Virtus

License:MIT License


Languages

Language:Ruby 100.0%