Class: EasyqaApi::Status
Overview
Status representation on EasyQA website
Constant Summary
Constants inherited from Item
Constants included from ClassMethodsSettable
Instance Attribute Summary collapse
-
#attributes ⇒ Hash
Item attributes from response body in your requests.
-
#id ⇒ Fixnum
The uniq identeficator item on EasyQA website.
-
#name ⇒ String
Status name on EasyQA.
-
#project_token ⇒ String
Your project token.
Class Method Summary collapse
-
.all(project_token, user = @@default_user) ⇒ Array
Retrieve all issues in project.
Instance Method Summary collapse
-
#create(attrs, user = @@default_user) ⇒ Hash
Create status on EasyQA website Have a class method analog.
-
#delete(project_token = @project_token, id = @id, user = @@default_user) ⇒ Hash
Delete status on EasyQA website Have a class method analog.
-
#show(project_token = @project_token, id = @id, user = @@default_user) ⇒ Hash
Show status from EasyQA website Have a class method analog.
-
#update(attrs, user = @@default_user) ⇒ Hash
Update status on EasyQA website Have a class method analog.
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 ⇒ Hash
Returns item attributes from response body in your requests.
15 |
# File 'lib/easyqa_api/items/status.rb', line 15 attr_accessor :name, :id, :attributes, :project_token |
#id ⇒ Fixnum
Returns The uniq identeficator item on EasyQA website.
15 |
# File 'lib/easyqa_api/items/status.rb', line 15 attr_accessor :name, :id, :attributes, :project_token |
#name ⇒ String
Returns Status name on EasyQA.
15 16 17 |
# File 'lib/easyqa_api/items/status.rb', line 15 def name @name end |
#project_token ⇒ String
Returns your project token.
15 |
# File 'lib/easyqa_api/items/status.rb', line 15 attr_accessor :name, :id, :attributes, :project_token |
Class Method Details
.all(project_token, user = @@default_user) ⇒ Array
Retrieve all issues in project
24 25 26 27 28 29 30 31 |
# File 'lib/easyqa_api/items/status.rb', line 24 def self.all(project_token, user = @@default_user) send_request('statuses', :get) do |req| req.params = { auth_token: user.auth_token, token: project_token } end end |
Instance Method Details
#create(attrs, user = @@default_user) ⇒ Hash
Create status on EasyQA website Have a class method analog
35 36 37 38 39 40 41 42 43 44 |
# File 'lib/easyqa_api/items/status.rb', line 35 def create(attrs, user = @@default_user) attrs = { project_token: @project_token }.merge(attrs) @attributes = send_request('statuses', :post) do |req| req.body = { status_object: attrs.slice(:name), token: attrs[:project_token], auth_token: user.auth_token } end end |
#delete(project_token = @project_token, id = @id, user = @@default_user) ⇒ Hash
Delete status on EasyQA website Have a class method analog
73 74 75 76 77 78 79 80 |
# File 'lib/easyqa_api/items/status.rb', line 73 def delete(project_token = @project_token, id = @id, user = @@default_user) @attributes = send_request("statuses/#{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) ⇒ Hash
Show status from EasyQA website Have a class method analog
48 49 50 51 52 53 54 55 |
# File 'lib/easyqa_api/items/status.rb', line 48 def show(project_token = @project_token, id = @id, user = @@default_user) @attributes = send_request("statuses/#{id}", :get) do |req| req.params = { token: project_token, auth_token: user.auth_token } end end |
#update(attrs, user = @@default_user) ⇒ Hash
Update status on EasyQA website Have a class method analog
60 61 62 63 64 65 66 67 68 69 |
# File 'lib/easyqa_api/items/status.rb', line 60 def update(attrs, user = @@default_user) attrs = { id: @id, project_token: @project_token }.merge(attrs) @attributes = send_request("statuses/#{attrs[:id]}", :put) do |req| req.body = { status_object: attrs.slice(:name), token: attrs[:project_token], auth_token: user.auth_token } end end |