Class: OnlyofficeTestrailWrapper::TestrailMilestone

Inherits:
Object
  • Object
show all
Defined in:
lib/onlyoffice_testrail_wrapper/testrail_milestone.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name = '', description = '', is_completed = false, id = nil) ⇒ TestrailMilestone

Returns a new instance of TestrailMilestone.



7
8
9
10
11
12
# File 'lib/onlyoffice_testrail_wrapper/testrail_milestone.rb', line 7

def initialize(name = '', description = '', is_completed = false, id = nil)
  @id = id.to_i
  @name = name
  @description = description
  @is_completed = is_completed
end

Instance Attribute Details

#descriptionObject

Returns the value of attribute description.



5
6
7
# File 'lib/onlyoffice_testrail_wrapper/testrail_milestone.rb', line 5

def description
  @description
end

#idObject

Returns the value of attribute id.



5
6
7
# File 'lib/onlyoffice_testrail_wrapper/testrail_milestone.rb', line 5

def id
  @id
end

#is_completedObject

Returns the value of attribute is_completed.



5
6
7
# File 'lib/onlyoffice_testrail_wrapper/testrail_milestone.rb', line 5

def is_completed
  @is_completed
end

#nameObject

Returns the value of attribute name.



5
6
7
# File 'lib/onlyoffice_testrail_wrapper/testrail_milestone.rb', line 5

def name
  @name
end

Instance Method Details

#deleteObject



19
20
21
# File 'lib/onlyoffice_testrail_wrapper/testrail_milestone.rb', line 19

def delete
  Testrail2.http_post "index.php?/api/v2/delete_milestone/#{@id}", {}
end

#update(is_completed = false, name = @name, description = @description) ⇒ Object



14
15
16
17
# File 'lib/onlyoffice_testrail_wrapper/testrail_milestone.rb', line 14

def update(is_completed = false, name = @name, description = @description)
  HashHelper.parse_to_class_variable(Testrail2.http_post("index.php?/api/v2/update_milestone/#{@id}", name: name, description: description,
                                                                                                      is_completed: is_completed), TestrailMilestone)
end