Class: Dynamoid::Undumping::DateUndumper

Inherits:
Base
  • Object
show all
Defined in:
lib/dynamoid/undumping.rb

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Dynamoid::Undumping::Base

Instance Method Details

#process(value) ⇒ Object



175
176
177
178
179
180
181
182
183
184
185
186
187
# File 'lib/dynamoid/undumping.rb', line 175

def process(value)
  use_string_format = if @options[:store_as_string].nil?
                        Dynamoid.config.store_date_as_string
                      else
                        @options[:store_as_string]
                      end

  if use_string_format
    Date.iso8601(value)
  else
    Dynamoid::Persistence::UNIX_EPOCH_DATE + value.to_i
  end
end