lib/surrealist/builder.rb
# Makes the value of appropriate key of the schema an array and pushes in results of iterating through
#   records and surrealizing them
#
# @param [Hash] schema the schema defined in the object's class.
# @param [Object] instance the instance of the object which methods from the schema are called on.
# @param [Symbol] key the symbol that represents method on the instance
# @param [Any] value returned when key is called on instance
#
# @return [Hash] the schema hash
Makes the value of appropriate key of the schema an array and pushes in results of iterating through
records and surrealizing them
Makes the value of appropriate key of the schema an array and pushes in results of iterating through records and surrealizing them
def construct_collection(schema, instance, key, value)
      schema[key] = instance.send(key).map do |inst|
        call(Copier.deep_copy(value), inst)
      end
    end
def construct_collection ( schema , instance , key , value ) schema [ key ] = instance . send ( key ) . map do | inst | call ( Copier . deep_copy ( value ) , inst ) end end
Makes the value of appropriate key of the schema an array and pushes in results of iterating through
records and surrealizing them
Makes the value of appropriate key of the schema an array and pushes in results of iterating through records and surrealizing them
the schema hash
the schema hash
Hash
schema
<not_specific>
instance
<not_specific>
key
<not_specific>
value
<not_specific>
<not_specific>
value returned when key is called on instance
value returned when key is called on instance