Class: Middleman::Sitemap::Extensions::Redirects::RedirectDescriptor

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#pathObject

Returns the value of attribute path

Returns:

  • (Object)

    the current value of path


17
18
19
# File 'middleman-core/lib/middleman-core/sitemap/extensions/redirects.rb', line 17

def path
  @path
end

#templateObject

Returns the value of attribute template

Returns:

  • (Object)

    the current value of template


17
18
19
# File 'middleman-core/lib/middleman-core/sitemap/extensions/redirects.rb', line 17

def template
  @template
end

#toObject

Returns the value of attribute to

Returns:

  • (Object)

    the current value of to


17
18
19
# File 'middleman-core/lib/middleman-core/sitemap/extensions/redirects.rb', line 17

def to
  @to
end

Instance Method Details

#execute_descriptor(app, resource_list) ⇒ Object


18
19
20
21
22
23
24
25
26
27
# File 'middleman-core/lib/middleman-core/sitemap/extensions/redirects.rb', line 18

def execute_descriptor(app, resource_list)
  r = RedirectResource.new(
    app.sitemap,
    path,
    to
  )
  r.output = template if template

  resource_list.add! r
end