# File lib/aws/core/option_grammar.rb, line 72 def encode_value(value) value.to_s # value.to_s # case value # when Integer # when # case value # when nil, '' then nil # when DateTime then raw # when Integer then DateTime.parse(Time.at(raw).to_s) # timestamp # else DateTime.parse(raw.to_s) # work with Time, Date and String objects # end end
# File lib/aws/core/option_grammar.rb, line 55 def validate(value, context = nil) true # raise format_error("timestamp value", context) unless # case value # when String # value =~ /^\d+$/ or value =~ /^\d{4}-\d{2}-d{2}T\d{2}:\d{2}:\d{2}Z$/ # when String then value =~ /^2009-12-04T20:56:05.000Z\d+$/ # when Integer then true # when DateTime then true # when Timestamp then true # when Date then true # else false # end # end # value.respond_to? :to_str end