Class: GitlabJanitor::ContainerCleaner::Model
Instance Attribute Summary
#model
Instance Method Summary
collapse
#method_missing, #respond_to?, #respond_to_missing?
Constructor Details
#initialize(model) ⇒ Model
Returns a new instance of Model.
6
7
8
9
10
|
# File 'lib/gitlab_janitor/container_cleaner.rb', line 6
def initialize(model)
super(model)
info['_Age'] = (Time.now - Time.at(created_at)).round(0)
end
|
Instance Method Details
#age ⇒ Object
20
21
22
|
# File 'lib/gitlab_janitor/container_cleaner.rb', line 20
def age
info['_Age']
end
|
#age_text ⇒ Object
24
25
26
|
# File 'lib/gitlab_janitor/container_cleaner.rb', line 24
def age_text
Fugit::Duration.parse(age).deflate.to_plain_s
end
|
#created_at ⇒ Object
12
13
14
|
# File 'lib/gitlab_janitor/container_cleaner.rb', line 12
def created_at
info['Created']
end
|
#name ⇒ Object
16
17
18
|
# File 'lib/gitlab_janitor/container_cleaner.rb', line 16
def name
@name ||= info['Names'].first.sub(%r{^/}, '')
end
|