Commit 822efd5c authored by Lin Jen-Shin's avatar Lin Jen-Shin

Struct.new could take a block for defining methods, feedback:

https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6084#note_15091858
parent 27a3f118
......@@ -79,8 +79,7 @@ module Gitlab
module PipelineDuration
extend self
PeriodStruct = Struct.new(:first, :last)
class Period < PeriodStruct
Period = Struct.new(:first, :last) do
def duration
last - first
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment