Class: RSchema::PredicateSchema
- Inherits:
-
Struct
- Object
- Struct
- RSchema::PredicateSchema
- Defined in:
- lib/rschema.rb
Instance Attribute Summary collapse
-
#block ⇒ Object
Returns the value of attribute block.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
Instance Attribute Details
#block ⇒ Object
Returns the value of attribute block
191 192 193 |
# File 'lib/rschema.rb', line 191 def block @block end |
#name ⇒ Object
Returns the value of attribute name
191 192 193 |
# File 'lib/rschema.rb', line 191 def name @name end |
Instance Method Details
#schema_walk(value, mapper) ⇒ Object
192 193 194 195 196 197 198 |
# File 'lib/rschema.rb', line 192 def schema_walk(value, mapper) if block.call(value) value else RSchema::ErrorDetails.new(value, 'fails predicate' + (name ? ": #{name}" : '')) end end |