Class: Membrane::Schemas::Regexp
- Defined in:
- lib/membrane/schemas/regexp.rb
Defined Under Namespace
Classes: MatchValidator, StringValidator
Instance Attribute Summary collapse
-
#regexp ⇒ Object
readonly
Returns the value of attribute regexp.
Instance Method Summary collapse
-
#initialize(regexp) ⇒ Regexp
constructor
A new instance of Regexp.
- #validate(object) ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(regexp) ⇒ Regexp
Returns a new instance of Regexp.
12 13 14 |
# File 'lib/membrane/schemas/regexp.rb', line 12 def initialize(regexp) @regexp = regexp end |
Instance Attribute Details
#regexp ⇒ Object (readonly)
Returns the value of attribute regexp.
10 11 12 |
# File 'lib/membrane/schemas/regexp.rb', line 10 def regexp @regexp end |
Instance Method Details
#validate(object) ⇒ Object
16 17 18 19 20 21 |
# File 'lib/membrane/schemas/regexp.rb', line 16 def validate(object) StringValidator.new(object).validate MatchValidator.new(@regexp, object).validate nil end |