Sha256: 7624e56d096176459d55b8981e766bd4f2746add64d0b0c1bc732cc8e44bcf33

Contents?: true

Size: 783 Bytes

Versions: 1

Compression:

Stored size: 783 Bytes

Contents

# frozen_string_literal: true

module ChemScanner
  module ChemDraw
    # CDX Bracket parser
    class BracketGroup < BaseNode
      require "chem_scanner/chem_draw/node/bracket_attachment"

      attr_reader :attachments, :object_ids

      def initialize(parser, parser_type, id)
        super(parser, parser_type, id)

        @attachments = []
        @object_ids = []
      end

      def parse_node(tag, id, data)
        if @props_ref[tag] == "BracketedObjects"
          @object_ids = read_value(tag, data)
          return
        end

        return do_unhandled(tag) unless @obj_ref[tag] == "BracketAttachment"

        attachment = BracketAttachment.new(@parser, @parser_type, id)
        attachment.read
        @attachments.push(attachment)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
chem_scanner-0.1.3 lib/chem_scanner/chem_draw/node/bracket_group.rb