Module: Eco::Data::Files::Timestamp
- Included in:
- ClassMethods
- Defined in:
- lib/eco/data/files/timestamp.rb
Constant Summary collapse
- DEFAULT_TIMESTAMP =
'%Y-%m-%dT%H%M%S'.freeze
Instance Method Summary collapse
- #timestamp(timestamp_pattern = DEFAULT_TIMESTAMP, date = Time.now) ⇒ Object
- #timestamp_file(filename, timestamp_pattern = DEFAULT_TIMESTAMP) ⇒ Object
Instance Method Details
#timestamp(timestamp_pattern = DEFAULT_TIMESTAMP, date = Time.now) ⇒ Object
7 8 9 |
# File 'lib/eco/data/files/timestamp.rb', line 7 def ( = DEFAULT_TIMESTAMP, date = Time.now) date.strftime() end |
#timestamp_file(filename, timestamp_pattern = DEFAULT_TIMESTAMP) ⇒ Object
11 12 13 14 |
# File 'lib/eco/data/files/timestamp.rb', line 11 def (filename, = DEFAULT_TIMESTAMP) file_pattern = Eco::Data::Files::FilePattern.new(filename) file_pattern.resolve(start: "#{()}_") end |