Struct.new could take a block for defining methods, feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6084#note_15091858
This commit is contained in:
parent
27a3f1182a
commit
822efd5c3b
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue