Class: RSchema::MaybeSchema

Inherits:
Struct
  • Object
show all
Defined in:
lib/rschema.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#subschemaObject

Returns the value of attribute subschema

Returns:

  • (Object)

    the current value of subschema



201
202
203
# File 'lib/rschema.rb', line 201

def subschema
  @subschema
end

Instance Method Details

#schema_walk(value, mapper) ⇒ Object



202
203
204
205
206
207
208
209
# File 'lib/rschema.rb', line 202

def schema_walk(value, mapper)
  if value.nil?
    value
  else
    subvalue_walked, error = RSchema.walk(subschema, value, mapper)
    error || subvalue_walked
  end
end