Exception: Atomy::PatternMismatch

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/atomy/errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(pattern, value) ⇒ PatternMismatch

Returns a new instance of PatternMismatch.



31
32
33
34
# File 'lib/atomy/errors.rb', line 31

def initialize(pattern, value)
  @pattern = pattern
  @value = value
end

Instance Attribute Details

#patternObject (readonly)

Returns the value of attribute pattern.



29
30
31
# File 'lib/atomy/errors.rb', line 29

def pattern
  @pattern
end

#valueObject (readonly)

Returns the value of attribute value.



29
30
31
# File 'lib/atomy/errors.rb', line 29

def value
  @value
end

Instance Method Details

#to_sObject



36
37
38
# File 'lib/atomy/errors.rb', line 36

def to_s
  "pattern `#{pattern}' did not match value `#{value.inspect}'"
end