Class: Aws::Xml::Parser::TimestampFrame Private

Inherits:
Frame
  • Object
show all
Defined in:
lib/aws-sdk-core/xml/parser/frame.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Attribute Summary

Attributes inherited from Frame

#parent, #ref

Instance Method Summary collapse

Methods inherited from Frame

#child_frame, #consume_child_frame, #initialize, new, #path, #set_text, #yield_unhandled_value

Constructor Details

This class inherits a constructor from Aws::Xml::Parser::Frame

Instance Method Details

#parse(value) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


277
278
279
280
281
282
283
284
285
286
287
288
# File 'lib/aws-sdk-core/xml/parser/frame.rb', line 277

def parse(value)
  case value
  when nil then nil
  when /^\d+$/ then Time.at(value.to_i)
  else
    begin
      Time.parse(value).utc
    rescue ArgumentError
      raise "unhandled timestamp format `#{value}'"
    end
  end
end

#resultObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


274
275
276
# File 'lib/aws-sdk-core/xml/parser/frame.rb', line 274

def result
  @text.empty? ? nil : parse(@text.join)
end