Class: ServerlessRedirector::Manifest::Redirect

Inherits:
Struct
  • Object
show all
Defined in:
lib/serverless_redirector/manifest.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(h = {}) ⇒ Redirect

Returns a new instance of Redirect.



6
7
8
# File 'lib/serverless_redirector/manifest.rb', line 6

def initialize(h = {})
  super h.fetch('path'), h.fetch('url')
end

Instance Attribute Details

#pathObject

Returns the value of attribute path

Returns:

  • (Object)

    the current value of path



4
5
6
# File 'lib/serverless_redirector/manifest.rb', line 4

def path
  @path
end

#urlObject

Returns the value of attribute url

Returns:

  • (Object)

    the current value of url



4
5
6
# File 'lib/serverless_redirector/manifest.rb', line 4

def url
  @url
end

Instance Method Details

#serializable_hash(options = {}) ⇒ Object



10
11
12
13
14
15
# File 'lib/serverless_redirector/manifest.rb', line 10

def serializable_hash(options = {})
  {
    'path' => path,
    'url'  => url
  }
end