class EmbeddedModel::Type
Public Class Methods
new(&builder)
click to toggle source
# File lib/embedded_model/type.rb, line 3 def initialize(&builder) @builder = builder end
Public Instance Methods
cast(attrs)
click to toggle source
# File lib/embedded_model/type.rb, line 7 def cast(attrs) @builder.call(attrs) end
deserialize(json)
click to toggle source
Calls superclass method
# File lib/embedded_model/type.rb, line 15 def deserialize(json) cast(super) end
serialize(obj)
click to toggle source
Calls superclass method
# File lib/embedded_model/type.rb, line 11 def serialize(obj) super(obj.as_json) end