Class: RSchema::GenericSetSchema
- Inherits:
-
Struct
- Object
- Struct
- RSchema::GenericSetSchema
- Defined in:
- lib/rschema.rb
Instance Attribute Summary collapse
-
#subschema ⇒ Object
Returns the value of attribute subschema.
Instance Method Summary collapse
Instance Attribute Details
#subschema ⇒ Object
Returns the value of attribute subschema
158 159 160 |
# File 'lib/rschema.rb', line 158 def subschema @subschema end |
Instance Method Details
#schema_walk(value, mapper) ⇒ Object
159 160 161 162 163 164 165 166 167 168 169 |
# File 'lib/rschema.rb', line 159 def schema_walk(value, mapper) return RSchema::ErrorDetails.new('is not a Set') if not value.is_a?(Set) value.reduce(Set.new) do |accum, subvalue| subvalue_walked, error = RSchema.walk(subschema, subvalue, mapper) break RSchema::ErrorDetails.new(Set.new([error.details])) if error accum << subvalue_walked accum end end |