Class: Kuby::Docker::TimestampTag
- Inherits:
-
Object
- Object
- Kuby::Docker::TimestampTag
- Defined in:
- lib/kuby/docker/timestamp_tag.rb
Constant Summary collapse
- RE =
/20[\d]{2}(?:0[1-9]|11|12)(?:0[1-9]|1[1-9]|2[1-9]|3[01])/.freeze
- FORMAT =
'%Y%m%d%H%M%S'.freeze
Instance Attribute Summary collapse
-
#time ⇒ Object
readonly
Returns the value of attribute time.
Class Method Summary collapse
Instance Method Summary collapse
- #<=>(other) ⇒ Object
- #eql?(other) ⇒ Boolean
- #hash ⇒ Object
-
#initialize(time) ⇒ TimestampTag
constructor
A new instance of TimestampTag.
- #to_s ⇒ Object
Constructor Details
#initialize(time) ⇒ TimestampTag
Returns a new instance of TimestampTag.
15 16 17 |
# File 'lib/kuby/docker/timestamp_tag.rb', line 15 def initialize(time) @time = time end |
Instance Attribute Details
#time ⇒ Object (readonly)
Returns the value of attribute time.
13 14 15 |
# File 'lib/kuby/docker/timestamp_tag.rb', line 13 def time @time end |
Class Method Details
Instance Method Details
#<=>(other) ⇒ Object
23 24 25 |
# File 'lib/kuby/docker/timestamp_tag.rb', line 23 def <=>(other) time <=> other.time end |
#eql?(other) ⇒ Boolean
31 32 33 |
# File 'lib/kuby/docker/timestamp_tag.rb', line 31 def eql?(other) time == other.time end |
#hash ⇒ Object
27 28 29 |
# File 'lib/kuby/docker/timestamp_tag.rb', line 27 def hash time.hash end |
#to_s ⇒ Object
19 20 21 |
# File 'lib/kuby/docker/timestamp_tag.rb', line 19 def to_s time.strftime(FORMAT) end |