Class: GenesisRuby::Utils::Formatters::Response::Formats::Timestamp

Inherits:
Base
  • Object
show all
Defined in:
lib/genesis_ruby/utils/formatters/response/formats/timestamp.rb

Overview

Response Timestamp format

Instance Method Summary collapse

Methods inherited from Base

#collect_required_key_values, #required_keys

Instance Method Details

#format_key(timestamp) ⇒ Object

Format the given timestamp to DateTime object



20
21
22
23
24
# File 'lib/genesis_ruby/utils/formatters/response/formats/timestamp.rb', line 20

def format_key(timestamp)
  DateTime.parse timestamp
rescue StandardError
  timestamp
end

#formatting_keysObject

The Response keys that the formatter will be applied to



15
16
17
# File 'lib/genesis_ruby/utils/formatters/response/formats/timestamp.rb', line 15

def formatting_keys
  %w(timestamp transactionDate valueDate transaction_date post_date)
end