Class: LedgerSync::Domains::Serializer::Query::SerializerReferencesOneType

Inherits:
Object
  • Object
show all
Defined in:
lib/ledger_sync/domains/serializer/query.rb

Instance Method Summary collapse

Instance Method Details

#proxy(serializer:, resource:, attribute:) ⇒ Object



102
103
104
105
106
107
# File 'lib/ledger_sync/domains/serializer/query.rb', line 102

def proxy(serializer:, resource:, attribute:)
  item = resource.try(attribute)
  return nil unless item

  serializer.serialize(resource: item)
end