class Anvil::Client

Attributes

api_key[R]
base_url[R]

Public Class Methods

new(api_key, environment) click to toggle source
# File lib/anvil/client.rb, line 5
def initialize(api_key, environment)
  @api_key = api_key
  load_base_url_for(environment)
end

Public Instance Methods

vulnerabilities() click to toggle source
# File lib/anvil/client.rb, line 10
def vulnerabilities
  Anvil::Vulnerability.new(self)
end
vulnerability_templates() click to toggle source
# File lib/anvil/client.rb, line 14
def vulnerability_templates
  Anvil::VulnerabilityTemplate.new(self)
end

Private Instance Methods

load_base_url_for(environment) click to toggle source
# File lib/anvil/client.rb, line 20
def load_base_url_for(environment)
  case environment
  when 'localhost'
    @base_url = 'http://localhost:3000'
  when 'production'
    @base_url = 'https://app.conviso.com.br'
  when 'staging'
    @base_url = 'https://homologa.conviso.com.br'
  else
    raise ArgumentError, "environment must be 'production' or 'staging'"
  end
end