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

Returns:

  • (Object)

    the current value of metadata



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

def 
  
end

#pathObject

Returns the value of attribute path

Returns:

  • (Object)

    the current value of 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

Returns:

  • (Object)

    the current value of 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, resources) ⇒ Object



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

def execute_descriptor(app, resources)
  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)
  r.(
    locals: md.delete(:locals) || {},
    page: page_data || {},
    options: md
  )

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

  resources + [r]
end