Class: OnlyofficeTestrailWrapper::TestrailMilestone
- Inherits:
-
TestrailApiObject
- Object
- TestrailApiObject
- OnlyofficeTestrailWrapper::TestrailMilestone
- Defined in:
- lib/onlyoffice_testrail_wrapper/testrail_milestone.rb
Overview
Class for describing milestone data
Instance Attribute Summary collapse
-
#description ⇒ String
Description of milestone.
-
#id ⇒ Integer
Id of milestone.
-
#is_completed ⇒ Boolean
Is this milestone completed.
-
#name ⇒ String
Name of milestone.
Instance Method Summary collapse
-
#delete ⇒ Hash
Delete current milestone.
-
#initialize(name = '', description = '', is_completed = false, id = nil) ⇒ TestrailMilestone
constructor
A new instance of TestrailMilestone.
-
#update(is_completed = false, name = @name, description = @description) ⇒ TestrailMilestone
Update current milestone.
Methods inherited from TestrailApiObject
#init_from_hash, #name_id_pairs
Constructor Details
#initialize(name = '', description = '', is_completed = false, id = nil) ⇒ TestrailMilestone
Returns a new instance of TestrailMilestone.
15 16 17 18 19 20 21 |
# File 'lib/onlyoffice_testrail_wrapper/testrail_milestone.rb', line 15 def initialize(name = '', description = '', is_completed = false, id = nil) super() @id = id.to_i @name = name @description = description @is_completed = is_completed end |
Instance Attribute Details
#description ⇒ String
Returns description of milestone.
11 12 13 |
# File 'lib/onlyoffice_testrail_wrapper/testrail_milestone.rb', line 11 def description @description end |
#id ⇒ Integer
Returns id of milestone.
7 8 9 |
# File 'lib/onlyoffice_testrail_wrapper/testrail_milestone.rb', line 7 def id @id end |
#is_completed ⇒ Boolean
Returns is this milestone completed.
13 14 15 |
# File 'lib/onlyoffice_testrail_wrapper/testrail_milestone.rb', line 13 def is_completed @is_completed end |
#name ⇒ String
Returns name of milestone.
9 10 11 |
# File 'lib/onlyoffice_testrail_wrapper/testrail_milestone.rb', line 9 def name @name end |
Instance Method Details
#delete ⇒ Hash
Delete current milestone
37 38 39 |
# File 'lib/onlyoffice_testrail_wrapper/testrail_milestone.rb', line 37 def delete Testrail2.http_post "index.php?/api/v2/delete_milestone/#{@id}", {} end |
#update(is_completed = false, name = @name, description = @description) ⇒ TestrailMilestone
Update current milestone
28 29 30 31 32 33 |
# File 'lib/onlyoffice_testrail_wrapper/testrail_milestone.rb', line 28 def update(is_completed = false, name = @name, description = @description) TestrailMilestone.new.init_from_hash(Testrail2.http_post("index.php?/api/v2/update_milestone/#{@id}", name: name, description: description, is_completed: is_completed)) end |