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.


301
302
303
304
305
306
307
308
309
310
311
312
# File 'lib/aws-sdk-core/xml/parser/frame.rb', line 301

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.


298
299
300
# File 'lib/aws-sdk-core/xml/parser/frame.rb', line 298

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