Sha256: 206c713e4205d5937ecb14d0a486aa61dc7501e955703a04aadfc1b2d18c8bf3

Contents?: true

Size: 573 Bytes

Versions: 7

Compression:

Stored size: 573 Bytes

Contents

module AWS
  module Record
    module Attributes
      class SerializedAttr < BaseAttr

        # OVERRIDE
        # https://github.com/aws/aws-sdk-ruby/blob/master/lib/aws/record/attributes.rb#L372
        # Allow Time instead of just DateTime
        def self.serialize datetime, options = {}
          unless datetime.is_a?(DateTime) || datetime.is_a?(Time)
            msg = "expected a DateTime value, got #{datetime.class}"
            raise ArgumentError, msg
          end
          datetime.strftime('%Y-%m-%dT%H:%M:%S%Z')
        end

      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
dyna_model-0.0.15 lib/dyna_model/aws/record/attributes/date_time_attr.rb
dyna_model-0.0.14 lib/dyna_model/aws/record/attributes/date_time_attr.rb
dyna_model-0.0.13 lib/dyna_model/aws/record/attributes/date_time_attr.rb
dyna_model-0.0.12 lib/dyna_model/aws/record/attributes/date_time_attr.rb
dyna_model-0.0.11 lib/dyna_model/aws/record/attributes/date_time_attr.rb
dyna_model-0.0.10 lib/dyna_model/aws/record/attributes/date_time_attr.rb
dyna_model-0.0.9 lib/dyna_model/aws/record/attributes/date_time_attr.rb