Class: Mill::Resource::Redirect
- Inherits:
-
Mill::Resource
- Object
- Mill::Resource
- Mill::Resource::Redirect
- Defined in:
- lib/mill/resources/redirect.rb
Constant Summary
Constants inherited from Mill::Resource
Instance Attribute Summary collapse
-
#redirect_code ⇒ Object
Returns the value of attribute redirect_code.
-
#redirect_uri ⇒ Object
Returns the value of attribute redirect_uri.
Attributes inherited from Mill::Resource
#content, #date, #input_file, #output_file, #public, #site
Instance Method Summary collapse
-
#initialize(redirect_uri:, redirect_code: 303, **args) ⇒ Redirect
constructor
A new instance of Redirect.
- #inspect ⇒ Object
- #load ⇒ Object
- #save ⇒ Object
Methods inherited from Mill::Resource
#absolute_uri, #build, #change_frequency, #final_content, #find_sibling_resources, #parent_uri, #public?, #tag_uri, #uri
Constructor Details
#initialize(redirect_uri:, redirect_code: 303, **args) ⇒ Redirect
Returns a new instance of Redirect.
10 11 12 13 14 |
# File 'lib/mill/resources/redirect.rb', line 10 def initialize(redirect_uri:, redirect_code: 303, **args) @redirect_uri = redirect_uri @redirect_code = redirect_code super(**args) end |
Instance Attribute Details
#redirect_code ⇒ Object
Returns the value of attribute redirect_code.
8 9 10 |
# File 'lib/mill/resources/redirect.rb', line 8 def redirect_code @redirect_code end |
#redirect_uri ⇒ Object
Returns the value of attribute redirect_uri.
7 8 9 |
# File 'lib/mill/resources/redirect.rb', line 7 def redirect_uri @redirect_uri end |
Instance Method Details
#inspect ⇒ Object
16 17 18 19 20 21 |
# File 'lib/mill/resources/redirect.rb', line 16 def inspect super + ", redirect_uri: %p, redirect_code: %p" % [ @redirect_uri.to_s, @redirect_code, ] end |
#load ⇒ Object
23 24 25 26 |
# File 'lib/mill/resources/redirect.rb', line 23 def load @content = "%s %d" % [@redirect_uri, @redirect_code] super end |
#save ⇒ Object
28 29 30 31 |
# File 'lib/mill/resources/redirect.rb', line 28 def save @output_file = @output_file.add_extension('.redirect') super end |