Class: Gitloggl::Gitlab::Issue
- Inherits:
-
Struct
- Object
- Struct
- Gitloggl::Gitlab::Issue
- Defined in:
- lib/gitloggl/gitlab/issue.rb
Constant Summary collapse
- ISSUE_PATH_RE =
“poslogic-partner#471”
/([[[:alnum:]]_-]*)#(\d+)/
Instance Attribute Summary collapse
-
#notes ⇒ Object
Returns the value of attribute notes.
-
#project_id ⇒ Object
Returns the value of attribute project_id.
-
#spent_ms ⇒ Object
Returns the value of attribute spent_ms.
-
#title ⇒ Object
Returns the value of attribute title.
Instance Method Summary collapse
Instance Attribute Details
#notes ⇒ Object
Returns the value of attribute notes.
6 7 8 |
# File 'lib/gitloggl/gitlab/issue.rb', line 6 def notes @notes end |
#project_id ⇒ Object
Returns the value of attribute project_id
3 4 5 |
# File 'lib/gitloggl/gitlab/issue.rb', line 3 def project_id @project_id end |
#spent_ms ⇒ Object
Returns the value of attribute spent_ms
3 4 5 |
# File 'lib/gitloggl/gitlab/issue.rb', line 3 def spent_ms @spent_ms end |
#title ⇒ Object
Returns the value of attribute title
3 4 5 |
# File 'lib/gitloggl/gitlab/issue.rb', line 3 def title @title end |
Instance Method Details
#+(issue) ⇒ Object
19 20 21 22 |
# File 'lib/gitloggl/gitlab/issue.rb', line 19 def +(issue) self.spent_ms = spent_ms + issue.spent_ms self end |
#path ⇒ Object
12 13 14 15 16 17 |
# File 'lib/gitloggl/gitlab/issue.rb', line 12 def path return nil unless title =~ ISSUE_PATH_RE return nil unless $1.present? && $2.present? @path ||= OpenStruct.new(project_path: $1, issue_id: $2) end |
#spent_sec ⇒ Object
8 9 10 |
# File 'lib/gitloggl/gitlab/issue.rb', line 8 def spent_sec spent_ms.fdiv(1000).round end |