Class: Resync::Resource
- Includes:
- XML::Mapping
- Defined in:
- lib/resync/resource.rb
Overview
A resource (i.e., <url> or <sitemap>). See section 7, Sitemap Document Formats, in the ResourceSync specification.
Instance Attribute Summary
Attributes inherited from Augmented
Class Method Summary collapse
-
.all_xml_mapping_nodes(options = { mapping: nil, create: true }) ⇒ Object
ResourceSync schema requires ‘##other’ elements to appear last.
Instance Method Summary collapse
-
#capability ⇒ Object
———————————————————— Public methods.
-
#initialize(uri:, modified_time: nil, changefreq: nil, priority: nil, links: [], metadata: nil) ⇒ Resource
constructor
A new instance of Resource.
-
#uri=(value) ⇒ Object
———————————————————— Custom setters.
Methods inherited from Augmented
#at_time, #change, #completed_time, #from_time, #link_for, #links_for, #until_time
Constructor Details
#initialize(uri:, modified_time: nil, changefreq: nil, priority: nil, links: [], metadata: nil) ⇒ Resource
Returns a new instance of Resource.
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/resync/resource.rb', line 33 def initialize( # rubocop:disable Metrics/MethodLength, Metrics/ParameterLists uri:, modified_time: nil, changefreq: nil, priority: nil, links: [], metadata: nil ) super(links: links) self.uri = uri self.modified_time = modified_time self.changefreq = changefreq self.priority = priority self. = end |
Class Method Details
.all_xml_mapping_nodes(options = { mapping: nil, create: true }) ⇒ Object
ResourceSync schema requires ‘##other’ elements to appear last
67 68 69 |
# File 'lib/resync/resource.rb', line 67 def self.all_xml_mapping_nodes( = { mapping: nil, create: true }) xml_mapping_nodes() + superclass.all_xml_mapping_nodes() end |