class GrowViral::Keystore::ApplicationFetcher

Attributes

config[R]
name[R]
provider[R]

Public Class Methods

fetch(*args) click to toggle source
# File lib/keystore/application_fetcher.rb, line 4
def self.fetch(*args)
  new(*args).fetch
end
new(provider, name, deps) click to toggle source
# File lib/keystore/application_fetcher.rb, line 9
def initialize(provider, name, deps)
  @provider = provider
  @name = name
  @config = deps[:config]
end

Public Instance Methods

fetch() click to toggle source
# File lib/keystore/application_fetcher.rb, line 15
def fetch
  response = Net::HTTP.get_response(uri)
  Application.new JSON.parse(response.body)
end
uri() click to toggle source
# File lib/keystore/application_fetcher.rb, line 20
def uri
  @uri ||= URI.parse("#{config.host}/applications/#{name}?provider=#{provider}")
end