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



182
183
184
# File 'lib/rschema.rb', line 182

def subschema
  @subschema
end

Instance Method Details

#schema_walk(value, mapper) ⇒ Object



183
184
185
186
187
188
189
190
# File 'lib/rschema.rb', line 183

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