Sha256: 282882e2a68cb481eab72caef105ed9bd278ed5ae1a7026a51e4d192a927c8da
Contents?: true
Size: 578 Bytes
Versions: 14
Compression:
Stored size: 578 Bytes
Contents
# frozen_string_literal: true module Arclight ## # Plain ruby class to model serializing/deserializing digital object data class DigitalObject attr_reader :label, :href def initialize(label:, href:) @label = label.presence || href @href = href end def to_json(*) { label: label, href: href }.to_json end def self.from_json(json) object_data = JSON.parse(json) new(label: object_data['label'], href: object_data['href']) end def ==(other) href == other.href && label == other.label end end end
Version data entries
14 entries across 14 versions & 1 rubygems