Class: MustardClient::Mustard
- Inherits:
-
Object
- Object
- MustardClient::Mustard
- Defined in:
- lib/MustardClient.rb
Instance Attribute Summary collapse
-
#mustard_url ⇒ Object
Returns the value of attribute mustard_url.
-
#user_token ⇒ Object
Returns the value of attribute user_token.
Instance Method Summary collapse
- #authenticate(username, password) ⇒ Object
- #environments ⇒ Object
- #executions ⇒ Object
-
#initialize(url = 'localhost:8081', token = nil) ⇒ Mustard
constructor
A new instance of Mustard.
- #keywords ⇒ Object
- #projects ⇒ Object
- #results ⇒ Object
- #set_mustard_url(url) ⇒ Object
- #set_user_token(token) ⇒ Object
- #teams ⇒ Object
- #testcases ⇒ Object
- #users ⇒ Object
Constructor Details
#initialize(url = 'localhost:8081', token = nil) ⇒ Mustard
Returns a new instance of Mustard.
23 24 25 26 |
# File 'lib/MustardClient.rb', line 23 def initialize(url= 'localhost:8081', token=nil) @mustard_url = url @user_token = token end |
Instance Attribute Details
#mustard_url ⇒ Object
Returns the value of attribute mustard_url.
18 19 20 |
# File 'lib/MustardClient.rb', line 18 def mustard_url @mustard_url end |
#user_token ⇒ Object
Returns the value of attribute user_token.
18 19 20 |
# File 'lib/MustardClient.rb', line 18 def user_token @user_token end |
Instance Method Details
#authenticate(username, password) ⇒ Object
36 37 38 39 40 41 42 43 44 |
# File 'lib/MustardClient.rb', line 36 def authenticate(username, password) a = AuthenticateClient.new(@mustard_url, @user_token) r = a.authenticate(username, password) unless r['error'] @user_token = r['user']['token'] end return r end |
#environments ⇒ Object
62 63 64 |
# File 'lib/MustardClient.rb', line 62 def environments EnvironmentsClient.new(@mustard_url, @user_token) end |
#executions ⇒ Object
70 71 72 |
# File 'lib/MustardClient.rb', line 70 def executions ExecutionsClient.new(@mustard_url, @user_token) end |
#keywords ⇒ Object
74 75 76 |
# File 'lib/MustardClient.rb', line 74 def keywords KeywordsClient.new(@mustard_url, @user_token) end |
#projects ⇒ Object
50 51 52 |
# File 'lib/MustardClient.rb', line 50 def projects ProjectsClient.new(@mustard_url, @user_token) end |
#results ⇒ Object
66 67 68 |
# File 'lib/MustardClient.rb', line 66 def results ResultsClient.new(@mustard_url, @user_token) end |
#set_mustard_url(url) ⇒ Object
32 33 34 |
# File 'lib/MustardClient.rb', line 32 def set_mustard_url url @mustard_url = url end |
#set_user_token(token) ⇒ Object
28 29 30 |
# File 'lib/MustardClient.rb', line 28 def set_user_token token @user_token = token end |
#teams ⇒ Object
58 59 60 |
# File 'lib/MustardClient.rb', line 58 def teams TeamsClient.new(@mustard_url, @user_token) end |
#testcases ⇒ Object
54 55 56 |
# File 'lib/MustardClient.rb', line 54 def testcases TestcasesClient.new(@mustard_url, @user_token) end |
#users ⇒ Object
46 47 48 |
# File 'lib/MustardClient.rb', line 46 def users UsersClient.new(@mustard_url, @user_token) end |