Class: Contracts::Stringy::URLSafe
- Inherits:
-
Object
- Object
- Contracts::Stringy::URLSafe
- Defined in:
- lib/contracts/stringy.rb
Overview
A url safe string
Class Method Summary collapse
Class Method Details
.generate(*_args) ⇒ Object
81 82 83 |
# File 'lib/contracts/stringy.rb', line 81 def self.generate(*_args) URLSAFE_REGEX.generate end |
.valid?(value) ⇒ Boolean
77 78 79 |
# File 'lib/contracts/stringy.rb', line 77 def self.valid?(value) value.is_a? String and (value =~ URLSAFE_REGEX) != nil end |