class Graphoid::EmbedsOne
Public Instance Methods
create(parent, value, _)
click to toggle source
# File lib/graphoid/operators/inherited/embeds_one.rb, line 5 def create(parent, value, _) attrs = Attribute.correct(klass, value) parent.send(:"#{name}=", attrs) end
exec(_scope, value)
click to toggle source
# File lib/graphoid/operators/inherited/embeds_one.rb, line 10 def exec(_scope, value) _hash = {} value.each do |key, _value| operation = Operation.new(klass, key, _value) parsed = Graphoid.driver.parse(operation.operand, operation.value, operation.operator, klass.to_s.underscore) _hash.merge!(parsed) end _hash end