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
200 201 202 |
# File 'lib/rschema.rb', line 200 def subschema @subschema end |
Instance Method Details
#inspect ⇒ Object
213 214 215 |
# File 'lib/rschema.rb', line 213 def inspect "set_of(#{subschema.inspect})" end |
#schema_walk(value, mapper) ⇒ Object
201 202 203 204 205 206 207 208 209 210 211 |
# File 'lib/rschema.rb', line 201 def schema_walk(value, mapper) return RSchema::ErrorDetails.new(value, '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 error.extend_key_path('.values') if error accum << subvalue_walked accum end end |