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

Inherits:
Struct
  • Object
show all
Defined in:
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



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

def path
  @path
end

#templateObject

Returns the value of attribute template



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

def template
  @template
end

#toObject

Returns the value of attribute to



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

def to
  @to
end

Instance Method Details

#execute_descriptor(app, resources) ⇒ Object



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

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

  resources + [r]
end