Sha256: 58ad7f12678ca3d70ba498d98e6987db83374fc3e8c972b46d81b869b8291f50

Contents?: true

Size: 477 Bytes

Versions: 43

Compression:

Stored size: 477 Bytes

Contents

# frozen_string_literal: true
module Dato
  module Local
    module FieldType
      class RichText < Array
        def self.parse(ids, repo)
          items = if ids
                    ids.map { |id| repo.find(id) }
                  else
                    []
                  end
          new(items)
        end

        def to_hash(max_depth = 3, current_depth = 0)
          map { |item| item.to_hash(max_depth, current_depth) }
        end
      end
    end
  end
end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
dato-0.3.28 lib/dato/local/field_type/rich_text.rb
dato-0.3.27 lib/dato/local/field_type/rich_text.rb
dato-0.3.26 lib/dato/local/field_type/rich_text.rb
dato-0.3.25 lib/dato/local/field_type/rich_text.rb
dato-0.3.24 lib/dato/local/field_type/rich_text.rb
dato-0.3.23 lib/dato/local/field_type/rich_text.rb
dato-0.3.22 lib/dato/local/field_type/rich_text.rb
dato-0.3.21 lib/dato/local/field_type/rich_text.rb
dato-0.3.20 lib/dato/local/field_type/rich_text.rb
dato-0.3.19 lib/dato/local/field_type/rich_text.rb
dato-0.3.18 lib/dato/local/field_type/rich_text.rb
dato-0.3.17 lib/dato/local/field_type/rich_text.rb
dato-0.3.16 lib/dato/local/field_type/rich_text.rb
dato-0.3.15 lib/dato/local/field_type/rich_text.rb
dato-0.3.14 lib/dato/local/field_type/rich_text.rb
dato-0.3.13 lib/dato/local/field_type/rich_text.rb
dato-0.3.12 lib/dato/local/field_type/rich_text.rb
dato-0.3.9.1 lib/dato/local/field_type/rich_text.rb
dato-0.3.11 lib/dato/local/field_type/rich_text.rb
dato-0.3.10 lib/dato/local/field_type/rich_text.rb