Class: Veracode::API::Base

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/veracode/base.rb

Direct Known Subclasses

Admin, Mitigiation, Results, Upload

Constant Summary collapse

VERACODE_REQ_VER =
"vcode_request_version_1"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Base

Returns a new instance of Base.



18
19
20
21
22
23
# File 'lib/veracode/base.rb', line 18

def initialize(options={})
  attrs = Veracode::API.options.merge(options)
  Config::VALID_OPTIONS_KEYS.each do |key|
    send("#{key}=", options[key])
  end
end

Instance Attribute Details

#account_idObject

Returns the value of attribute account_id.



10
11
12
# File 'lib/veracode/base.rb', line 10

def 
  @account_id
end

Instance Method Details

#getXML(path, debug = false) ⇒ Object



40
41
42
# File 'lib/veracode/base.rb', line 40

def getXML(path, debug=false)
  self.class.get(path, headers: { "Authorization" => veracode_sign(path) })
end

#postAPI(path, query = {}, debug = false) ⇒ Object



34
35
36
37
38
# File 'lib/veracode/base.rb', line 34

def postAPI(path, query={}, debug=false)
  options = { :query => query, headers: { "Authorization" => veracode_sign(path, 'POST') } }

  self.class.post(path, options)
end