Class: Threadfix::Client::Applications::Lookup
- Inherits:
-
Object
- Object
- Threadfix::Client::Applications::Lookup
- Defined in:
- lib/threadfix/client/applications/lookup.rb
Constant Summary collapse
- API_VERSION =
'2.5.0.2'
Instance Attribute Summary collapse
-
#app_name ⇒ Object
readonly
Returns the value of attribute app_name.
-
#team_name ⇒ Object
readonly
Returns the value of attribute team_name.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Lookup
constructor
A new instance of Lookup.
- #perform! ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Lookup
Returns a new instance of Lookup.
9 10 11 12 |
# File 'lib/threadfix/client/applications/lookup.rb', line 9 def initialize(={}) @team_name = [:team_name] @app_name = [:app_name] end |
Instance Attribute Details
#app_name ⇒ Object (readonly)
Returns the value of attribute app_name.
7 8 9 |
# File 'lib/threadfix/client/applications/lookup.rb', line 7 def app_name @app_name end |
#team_name ⇒ Object (readonly)
Returns the value of attribute team_name.
7 8 9 |
# File 'lib/threadfix/client/applications/lookup.rb', line 7 def team_name @team_name end |
Instance Method Details
#perform! ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/threadfix/client/applications/lookup.rb', line 14 def perform! begin r = RestClient.get( endpoint.to_s, { :accept => "application/json", :Authorization => "APIKEY #{apiKey}" } ) JSON.parse(r.body) rescue RestClient::NotFound => e puts "Endpoint not found (using API version: #{API_VERSION})" raise e rescue RestClient::ExceptionWithResponse => e raise e end end |