class JsonbAccessor::NestedBase

def ==(suspect)

def ==(suspect)
  self.class == suspect.class && attributes == suspect.attributes
end

def []=(key, value)

def []=(key, value)
  send("#{key}=", value)
end

def initialize(attributes = {})

def initialize(attributes = {})
  self.attributes = {}.with_indifferent_access
  nested_classes.keys.each do |key|
    send("#{key}=", nil)
  end
  attributes.each do |name, value|
    send("#{name}=", value)
  end
end

def update_parent

def update_parent
  parent.send("#{attribute_on_parent_name}=", self) if parent
end