Class: Easy::Matchers::BaseValidationMatcher
- Inherits:
-
Object
- Object
- Easy::Matchers::BaseValidationMatcher
show all
- Defined in:
- lib/matchers/validations/base_validation_matcher.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
Returns a new instance of BaseValidationMatcher.
11
12
13
14
15
16
17
|
# File 'lib/matchers/validations/base_validation_matcher.rb', line 11
def initialize(attributes, type)
@attributes = attributes
@failure_message = nil
@failure_message_when_negated = nil
@type = type
@options = {}
end
|
Instance Attribute Details
#attributes ⇒ Object
Returns the value of attribute attributes.
4
5
6
|
# File 'lib/matchers/validations/base_validation_matcher.rb', line 4
def attributes
@attributes
end
|
#failure_message ⇒ Object
Returns the value of attribute failure_message.
4
5
6
|
# File 'lib/matchers/validations/base_validation_matcher.rb', line 4
def failure_message
@failure_message
end
|
#failure_message_when_negated ⇒ Object
Returns the value of attribute failure_message_when_negated.
4
5
6
|
# File 'lib/matchers/validations/base_validation_matcher.rb', line 4
def failure_message_when_negated
@failure_message_when_negated
end
|
#options ⇒ Object
Returns the value of attribute options.
4
5
6
|
# File 'lib/matchers/validations/base_validation_matcher.rb', line 4
def options
@options
end
|
#subject ⇒ Object
Returns the value of attribute subject.
4
5
6
|
# File 'lib/matchers/validations/base_validation_matcher.rb', line 4
def subject
@subject
end
|
#type ⇒ Object
Returns the value of attribute type.
4
5
6
|
# File 'lib/matchers/validations/base_validation_matcher.rb', line 4
def type
@type
end
|
Instance Method Details
#allow_blank ⇒ Object
48
49
50
|
# File 'lib/matchers/validations/base_validation_matcher.rb', line 48
def allow_blank
raise NotImplementedError, 'Subclasses must implement a allow_blank method.'
end
|
#allow_nil ⇒ Object
44
45
46
|
# File 'lib/matchers/validations/base_validation_matcher.rb', line 44
def allow_nil
raise NotImplementedError, 'Subclasses must implement a allow_nil method.'
end
|
#class_name ⇒ Object
24
25
26
|
# File 'lib/matchers/validations/base_validation_matcher.rb', line 24
def class_name
subject.class
end
|
#description ⇒ Object
28
29
30
|
# File 'lib/matchers/validations/base_validation_matcher.rb', line 28
def description
raise NotImplementedError, 'Subclasses must implement a description method.'
end
|
#if ⇒ Object
32
33
34
|
# File 'lib/matchers/validations/base_validation_matcher.rb', line 32
def if
raise NotImplementedError, 'Subclasses must implement a if method.'
end
|
#matches?(subject) ⇒ Boolean
19
20
21
22
|
# File 'lib/matchers/validations/base_validation_matcher.rb', line 19
def matches?(subject)
@subject = subject
false
end
|
#on(context) ⇒ Object
40
41
42
|
# File 'lib/matchers/validations/base_validation_matcher.rb', line 40
def on(context)
raise NotImplementedError, 'Subclasses must implement a on method.'
end
|
#strict ⇒ Object
52
53
54
|
# File 'lib/matchers/validations/base_validation_matcher.rb', line 52
def strict
raise NotImplementedError, 'Subclasses must implement a strict method.'
end
|
#unless ⇒ Object
36
37
38
|
# File 'lib/matchers/validations/base_validation_matcher.rb', line 36
def unless
raise NotImplementedError, 'Subclasses must implement a unless method.'
end
|