Sha256: 708534504f9bc8476f19a1656335afcf055160b008d2aa521b0e9cb38fc474e7
Contents?: true
Size: 566 Bytes
Versions: 26
Compression:
Stored size: 566 Bytes
Contents
# frozen_string_literal: true module Glossarist class DetailedDefinition < Model def initialize(attributes = {}) if attributes.is_a?(Hash) super else self.content = attributes end end # @return [String] attr_accessor :content # @return [Array<ConceptSource>] attr_reader :sources def sources=(sources) @sources = sources.map { |s| ConceptSource.new(s) } end def to_h { "content" => content, "sources" => sources&.map(&:to_h), }.compact end end end
Version data entries
26 entries across 26 versions & 2 rubygems