Sha256: af9a4453dfafc8b7a013b3a201c9e67535a08ddbee8d1ca4350d05f24feaf128

Contents?: true

Size: 941 Bytes

Versions: 10

Compression:

Stored size: 941 Bytes

Contents

# frozen_string_literal: true

module Kitchen
  # An element for metadata
  #
  class MetadataElement < ElementBase
    # Creates a new +MetadataElement+
    #
    # @param node [Nokogiri::XML::Node] the node this element wraps
    # @param document [Document] this element's document
    #
    def initialize(node:, document: nil)
      super(node: node,
            document: document,
            enumerator_class: MetadataElementEnumerator)
    end

    # Returns the short type
    # @return [Symbol]
    #
    def self.short_type
      :metadata
    end

    # Returns set of selected data elements
    #
    # @return [ElementEnumerator]
    #
    def children_to_keep
      search(%w(span[data-type='revised']
                span[data-type='slug']
                div.authors
                div.publishers
                div.print-style
                div.permissions
                div[data-type='subject']))
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
openstax_kitchen-19.0.0 lib/kitchen/metadata_element.rb
openstax_kitchen-18.0.0 lib/kitchen/metadata_element.rb
openstax_kitchen-17.1.0 lib/kitchen/metadata_element.rb
openstax_kitchen-17.0.0 lib/kitchen/metadata_element.rb
openstax_kitchen-16.0.0 lib/kitchen/metadata_element.rb
openstax_kitchen-15.0.0 lib/kitchen/metadata_element.rb
openstax_kitchen-14.0.0 lib/kitchen/metadata_element.rb
openstax_kitchen-13.0.0 lib/kitchen/metadata_element.rb
openstax_kitchen-12.2.0 lib/kitchen/metadata_element.rb
openstax_kitchen-12.1.0 lib/kitchen/metadata_element.rb