Class: Hummer::Client::API
- Inherits:
-
Object
- Object
- Hummer::Client::API
- Defined in:
- lib/hummer/client/api.rb
Class Method Summary collapse
- .configure(options) ⇒ Object
- .get(options = {}) ⇒ Object
- .post(project, file, build, feature_list) ⇒ Object
Class Method Details
.configure(options) ⇒ Object
7 8 9 10 11 12 13 14 15 |
# File 'lib/hummer/client/api.rb', line 7 def self.configure() @server = RestClient::Resource.new([:server], :headers => { "X-User-ID" => [:user], "X-User-Token" => [:token], "Accept" => "application/json" } ) end |
.get(options = {}) ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/hummer/client/api.rb', line 16 def self.get( = {}) if .has_key?(:project) and .has_key?(:suite) JSON @server['projects'][[:project]]['suites'][[:suite]].get elsif .has_key?(:project) JSON @server['projects'][[:project]]['suites'].get else JSON @server['projects'].get end end |
.post(project, file, build, feature_list) ⇒ Object
25 26 27 |
# File 'lib/hummer/client/api.rb', line 25 def self.post(project,file,build,feature_list) JSON @server['projects'][project]['suites'].post :tempest => File.open(file), :build => build, :feature_list => feature_list end |