Class: VCardio::Validator::GroupValidator

Inherits:
Object
  • Object
show all
Defined in:
lib/vcardio/validator/group_validator.rb

Overview

Group definition:

`1*(ALPHA / DIGIT / "-")`

Class Method Summary collapse

Class Method Details

.call(group) ⇒ Object



10
11
12
13
14
# File 'lib/vcardio/validator/group_validator.rb', line 10

def self.call(group)
  if /\A[A-Za-z\d-]*\z/.match(group).nil?
    fail VCardio::Error, "Invalid group: #{group}"
  end
end