Sha256: 99cc40382091950fd1f4aadf9aa8fd16d2bfd9a488db748a4284db83881d5610
Contents?: true
Size: 979 Bytes
Versions: 12
Compression:
Stored size: 979 Bytes
Contents
# frozen_string_literal: true module Kitchen # An element for a figure # class FigureElement < ElementBase # Creates a new +FigureElement+ # # @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: FigureElementEnumerator) end # Returns the short type # @return [Symbol] # def self.short_type :figure end # Returns the caption element # # @return [Element, nil] # def caption first('figcaption') end # Returns the Figure Title # # @return [Element, nil] # def title first("div[data-type='title']") end # Returns true if the figure is a child of another figure # # @return [Boolean] # def subfigure? parent.name == 'figure' end end end
Version data entries
12 entries across 12 versions & 1 rubygems