Sha256: 2e348794766373cdcccb42013813f1cefecd5a95bdc39c3d136fe22965aae366
Contents?: true
Size: 625 Bytes
Versions: 5
Compression:
Stored size: 625 Bytes
Contents
# frozen_string_literal: true require 'representable/json/collection' require 'wikibase_representable' module DigitalScriptorium # Representer class for deserializing Wikibase data exports from JSON. class ExportRepresenter < Representable::Decorator include Representable::JSON::Collection include WikibaseRepresentable::Model include WikibaseRepresentable::Representers items decorator: lambda { |input:, **| input.type == Item::ENTITY_TYPE ? ItemRepresenter : PropertyRepresenter }, class: lambda { |input:, **| input['type'] == Item::ENTITY_TYPE ? DsItem : Property } end end
Version data entries
5 entries across 5 versions & 1 rubygems