Class: Hermod::Validators::RegularExpression

Inherits:
Base
  • Object
show all
Defined in:
lib/hermod/validators/regular_expression.rb

Overview

Checks the value matches the given regular expression

Instance Attribute Summary collapse

Attributes inherited from Base

#attributes, #value

Instance Method Summary collapse

Methods inherited from Base

#valid?

Constructor Details

#initialize(pattern) ⇒ RegularExpression

Sets up the pattern the value is expected to match



10
11
12
# File 'lib/hermod/validators/regular_expression.rb', line 10

def initialize(pattern)
  @pattern = pattern
end

Instance Attribute Details

#patternObject (readonly)

Returns the value of attribute pattern.



7
8
9
# File 'lib/hermod/validators/regular_expression.rb', line 7

def pattern
  @pattern
end