Class: Veracode::API::Base
- Inherits:
-
Object
- Object
- Veracode::API::Base
- Includes:
- HTTParty
- Defined in:
- lib/veracode/base.rb
Direct Known Subclasses
Constant Summary collapse
- VERACODE_REQ_VER =
"vcode_request_version_1"
Instance Attribute Summary collapse
-
#account_id ⇒ Object
Returns the value of attribute account_id.
Instance Method Summary collapse
- #getXML(path, debug = false) ⇒ Object
-
#initialize(options = {}) ⇒ Base
constructor
A new instance of Base.
- #postAPI(path, query = {}, debug = false) ⇒ Object
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(={}) attrs = Veracode::API..merge() Config::VALID_OPTIONS_KEYS.each do |key| send("#{key}=", [key]) end end |
Instance Attribute Details
#account_id ⇒ Object
Returns the value of attribute account_id.
10 11 12 |
# File 'lib/veracode/base.rb', line 10 def account_id @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) = { :query => query, headers: { "Authorization" => veracode_sign(path, 'POST') } } self.class.post(path, ) end |