Class: Dynamoid::Undumping::BinaryUndumper

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



287
288
289
290
291
292
293
294
295
296
297
298
299
# File 'lib/dynamoid/undumping.rb', line 287

def process(value)
  store_as_binary = if @options[:store_as_native_binary].nil?
                      Dynamoid.config.store_binary_as_native
                    else
                      @options[:store_as_native_binary]
                    end

  if store_as_binary
    value.string # expect StringIO here
  else
    Base64.strict_decode64(value)
  end
end