Class: EasyqaApi::TestModule
- Defined in:
- lib/easyqa_api/items/test_module.rb
Constant Summary
Constants inherited from Item
Constants included from ClassMethodsSettable
Instance Attribute Summary collapse
-
#attributes ⇒ Object
Returns the value of attribute attributes.
-
#id ⇒ Object
Returns the value of attribute id.
-
#project_token ⇒ Object
Returns the value of attribute project_token.
-
#test_plan_id ⇒ Object
Returns the value of attribute test_plan_id.
-
#title ⇒ Object
Returns the value of attribute title.
Class Method Summary collapse
Instance Method Summary collapse
- #create(attrs, user = @@default_user) ⇒ Object
- #delete(project_token = @project_token, id = @id, user = @@default_user) ⇒ Object
- #show(project_token = @project_token, id = @id, user = @@default_user) ⇒ Object
- #update(attrs, user = @@default_user) ⇒ Object
Methods inherited from Item
#initialize, #install_variables!, json_connection, multipart_connection, operation_status, send_request
Methods included from ClassMethodsSettable
Constructor Details
This class inherits a constructor from EasyqaApi::Item
Instance Attribute Details
#attributes ⇒ Object
Returns the value of attribute attributes.
3 4 5 |
# File 'lib/easyqa_api/items/test_module.rb', line 3 def attributes @attributes end |
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'lib/easyqa_api/items/test_module.rb', line 3 def id @id end |
#project_token ⇒ Object
Returns the value of attribute project_token.
3 4 5 |
# File 'lib/easyqa_api/items/test_module.rb', line 3 def project_token @project_token end |
#test_plan_id ⇒ Object
Returns the value of attribute test_plan_id.
3 4 5 |
# File 'lib/easyqa_api/items/test_module.rb', line 3 def test_plan_id @test_plan_id end |
#title ⇒ Object
Returns the value of attribute title.
3 4 5 |
# File 'lib/easyqa_api/items/test_module.rb', line 3 def title @title end |
Class Method Details
.all(project_token, test_plan_id, user = @@default_user) ⇒ Object
7 8 9 10 11 12 13 14 |
# File 'lib/easyqa_api/items/test_module.rb', line 7 def self.all(project_token, test_plan_id, user = @@default_user) send_request("test_plans/#{test_plan_id}/test_modules", :get) do |req| req.params = { auth_token: user.auth_token, token: project_token } end end |
Instance Method Details
#create(attrs, user = @@default_user) ⇒ Object
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/easyqa_api/items/test_module.rb', line 16 def create(attrs, user = @@default_user) attrs = { project_token: @project_token, test_plan_id: @test_plan_id }.merge(attrs) @attributes = send_request("test_plans/#{attrs[:test_plan_id]}/test_modules", :post) do |req| req.body = { test_module: attrs.except(:project_token, :test_plan_id), token: attrs[:project_token], auth_token: user.auth_token } end end |
#delete(project_token = @project_token, id = @id, user = @@default_user) ⇒ Object
47 48 49 50 51 52 53 54 |
# File 'lib/easyqa_api/items/test_module.rb', line 47 def delete(project_token = @project_token, id = @id, user = @@default_user) @attributes = send_request("test_modules/#{id}", :delete) do |req| req.params = { token: project_token, auth_token: user.auth_token } end end |
#show(project_token = @project_token, id = @id, user = @@default_user) ⇒ Object
27 28 29 30 31 32 33 34 |
# File 'lib/easyqa_api/items/test_module.rb', line 27 def show(project_token = @project_token, id = @id, user = @@default_user) @attributes = send_request("test_modules/#{id}", :get) do |req| req.params = { token: project_token, auth_token: user.auth_token } end end |
#update(attrs, user = @@default_user) ⇒ Object
36 37 38 39 40 41 42 43 44 45 |
# File 'lib/easyqa_api/items/test_module.rb', line 36 def update(attrs, user = @@default_user) attrs = { id: @id, project_token: @project_token }.merge(attrs) @attributes = send_request("test_modules/#{attrs[:id]}", :put) do |req| req.body = { test_module: attrs.except(:project_token), token: attrs[:project_token], auth_token: user.auth_token } end end |