Class: Kitchen::MetadataElement
- Inherits:
-
ElementBase
- Object
- ElementBase
- Kitchen::MetadataElement
- Defined in:
- lib/kitchen/metadata_element.rb
Overview
An element for metadata
Instance Attribute Summary
Attributes inherited from ElementBase
#ancestors, #document, #enumerator_class, #search_query_that_found_me, #short_type
Class Method Summary collapse
-
.short_type ⇒ Symbol
Returns the short type.
Instance Method Summary collapse
-
#children_to_keep ⇒ ElementEnumerator
Returns set of selected data elements.
-
#initialize(node:, document: nil) ⇒ MetadataElement
constructor
Creates a new
MetadataElement
.
Methods inherited from ElementBase
#[], #[]=, #add_ancestor, #add_ancestors, #add_class, #ancestor, #ancestor_elements, #append, #as_enumerator, #children, #classes, #clone, #config, #contains?, #content, #copied_id, #copy, #count_in, #cut, #data_type, descendant, descendant!, #element_children, #first, #first!, #has_ancestor?, #has_class?, #href, #href=, #id, #id=, #inner_html=, #inspect, #is?, is_the_element_class_for?, #key?, #mark_as_current_location!, #name, #name=, #pages, #pantry, #parent, #paste, #path, #preceded_by_text, #prepend, #previous, #raw, #raw_search, #remember_that_a_sub_element_was_counted, #remove_attribute, #remove_class, #replace_children, #search, #search_history, #selectors, #set, #sub_header_name, #target_label, #text, #to_html, #to_s, #to_xhtml, #to_xml, #trash, #uncount, #wrap, #wrap_children
Methods included from Kitchen::Mixins::BlockErrorIf
Constructor Details
#initialize(node:, document: nil) ⇒ MetadataElement
Creates a new MetadataElement
12 13 14 15 16 |
# File 'lib/kitchen/metadata_element.rb', line 12 def initialize(node:, document: nil) super(node: node, document: document, enumerator_class: MetadataElementEnumerator) end |
Class Method Details
.short_type ⇒ Symbol
Returns the short type
21 22 23 |
# File 'lib/kitchen/metadata_element.rb', line 21 def self.short_type :metadata end |
Instance Method Details
#children_to_keep ⇒ ElementEnumerator
Returns set of selected data elements
29 30 31 32 33 34 35 36 37 |
# File 'lib/kitchen/metadata_element.rb', line 29 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 |