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
162 163 164 |
# File 'lib/rschema.rb', line 162 def subschema @subschema end |
Instance Method Details
#schema_walk(value, mapper) ⇒ Object
163 164 165 166 167 168 169 170 171 172 173 |
# File 'lib/rschema.rb', line 163 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 + ": " + subvalue.to_s])) if error accum << subvalue_walked accum end end |