Class: Middleman::Sitemap::Extensions::ProxyDescriptor

Inherits:
Struct
  • Object
show all
Defined in:
middleman-core/lib/middleman-core/sitemap/extensions/proxies.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#metadataObject

Returns the value of attribute metadata


34
35
36
# File 'middleman-core/lib/middleman-core/sitemap/extensions/proxies.rb', line 34

def 
  @metadata
end

#pathObject

Returns the value of attribute path


34
35
36
# File 'middleman-core/lib/middleman-core/sitemap/extensions/proxies.rb', line 34

def path
  @path
end

#targetObject

Returns the value of attribute target


34
35
36
# File 'middleman-core/lib/middleman-core/sitemap/extensions/proxies.rb', line 34

def target
  @target
end

Instance Method Details

#execute_descriptor(app, resource_list) ⇒ Object


35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'middleman-core/lib/middleman-core/sitemap/extensions/proxies.rb', line 35

def execute_descriptor(app, resource_list)
  md = .dup
  should_ignore = md.delete(:ignore)

  page_data = md.delete(:data) || {}
  page_data[:id] = md.delete(:id) if md.key?(:id)

  r = ProxyResource.new(app.sitemap, path, target)
  if (locs = md.delete(:locals))
    r.(locs)
  end

  r.(page_data) if page_data

  r.(md)

  if should_ignore
    d = ::Middleman::Sitemap::Extensions::Ignores::StringIgnoreDescriptor.new(target)
    d.execute_descriptor(app, resource_list)
  end

  resource_list.add! r
end