class ActiveModel::Serializer

def attributes(requested_attrs = nil, reload = false)

by the serializer.
Return the +attributes+ of +object+ as presented
def attributes(requested_attrs = nil, reload = false)
  @attributes = nil if reload
  @attributes ||= self.class._attributes_data.each_with_object({}) do |(key, attr), hash|
    next if attr.excluded?(self)
    next unless requested_attrs.nil? || requested_attrs.include?(key)
    hash[key] = attr.value(self)
  end
end