Sha256: 135b88f4715de36f64eef3d2fc0bd25a7da3937767769d9d104b612eed987f92
Contents?: true
Size: 499 Bytes
Versions: 31
Compression:
Stored size: 499 Bytes
Contents
# frozen_string_literal: true module DraftjsHtml module Draftjs class Content def self.parse(raw) new(raw['blocks'].map { Block.parse(**_1) }, EntityMap.parse(raw['entityMap'])) end attr_reader :blocks, :entity_map def initialize(blocks, entity_map) @blocks = blocks @entity_map = entity_map end def find_entity(key) entity_map[key] end def to_raw ToRaw.new.convert(self) end end end end
Version data entries
31 entries across 31 versions & 1 rubygems