Class: Chaplin::Parser::Redirects
- Inherits:
-
Struct
- Object
- Struct
- Chaplin::Parser::Redirects
- Defined in:
- lib/chaplin/parser/redirects.rb
Instance Attribute Summary collapse
-
#redirect_declarations ⇒ Object
Returns the value of attribute redirect_declarations.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#redirect_declarations ⇒ Object
Returns the value of attribute redirect_declarations
7 8 9 |
# File 'lib/chaplin/parser/redirects.rb', line 7 def redirect_declarations @redirect_declarations end |
Class Method Details
.load(redirect_declarations) ⇒ Object
9 10 11 |
# File 'lib/chaplin/parser/redirects.rb', line 9 def self.load(redirect_declarations) new(redirect_declarations).load end |
Instance Method Details
#load ⇒ Object
13 14 15 16 17 |
# File 'lib/chaplin/parser/redirects.rb', line 13 def load redirect_declarations.each_with_object({}) do |(redirect_name, redirect_data), redirects_hash| redirects_hash[redirect_name.to_s] = Responses::Redirect.new(redirect_data['path'], api_requests(redirect_data['requests'])) end end |