Class: StackMaster::ParameterResolvers::Http

Inherits:
Resolver
  • Object
show all
Defined in:
lib/stack_master/parameter_resolvers/http.rb

Constant Summary collapse

NotResolved =
Class.new(StandardError)

Instance Method Summary collapse

Constructor Details

#initialize(_config, _stack_definition) ⇒ Http

Returns a new instance of Http.



12
# File 'lib/stack_master/parameter_resolvers/http.rb', line 12

def initialize(_config, _stack_definition); end

Instance Method Details

#resolve(url) ⇒ Object



14
15
16
17
18
19
# File 'lib/stack_master/parameter_resolvers/http.rb', line 14

def resolve(url)
  response = connection(url).get
  response.body.split(/\s+/)
rescue Faraday::Error
  raise NotResolved, "Unable to resolve HTTP parameters from #{url}"
end