Class: Geet::Gitlab::Milestone
- Inherits:
-
Object
- Object
- Geet::Gitlab::Milestone
- Defined in:
- lib/geet/gitlab/milestone.rb
Instance Attribute Summary collapse
-
#due_on ⇒ Object
readonly
Returns the value of attribute due_on.
-
#number ⇒ Object
readonly
Returns the value of attribute number.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(number, title, due_on, api_interface) ⇒ Milestone
constructor
A new instance of Milestone.
Constructor Details
#initialize(number, title, due_on, api_interface) ⇒ Milestone
Returns a new instance of Milestone.
10 11 12 13 14 15 16 |
# File 'lib/geet/gitlab/milestone.rb', line 10 def initialize(number, title, due_on, api_interface) @number = number @title = title @due_on = due_on @api_interface = api_interface end |
Instance Attribute Details
#due_on ⇒ Object (readonly)
Returns the value of attribute due_on.
8 9 10 |
# File 'lib/geet/gitlab/milestone.rb', line 8 def due_on @due_on end |
#number ⇒ Object (readonly)
Returns the value of attribute number.
8 9 10 |
# File 'lib/geet/gitlab/milestone.rb', line 8 def number @number end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
8 9 10 |
# File 'lib/geet/gitlab/milestone.rb', line 8 def title @title end |
Class Method Details
.list(api_interface) ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/geet/gitlab/milestone.rb', line 20 def self.list(api_interface, **) api_path = "projects/#{api_interface.path_with_namespace(encoded: true)}/milestones" response = api_interface.send_request(api_path, multipage: true) response.map do |milestone_data| number = milestone_data.fetch('iid') title = milestone_data.fetch('title') due_on = parse_due_date(milestone_data.fetch('due_date')) new(number, title, due_on, api_interface) end end |