Class: Aws::Xml::Parser::TimestampFrame Private
- 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
Instance Method Summary collapse
- #parse(value) ⇒ Object private
- #result ⇒ Object private
Methods inherited from Frame
#child_frame, #consume_child_frame, #initialize, new, #set_text
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.
257 258 259 260 261 262 263 264 265 266 267 268 |
# File 'lib/aws-sdk-core/xml/parser/frame.rb', line 257 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 |
#result ⇒ 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.
254 255 256 |
# File 'lib/aws-sdk-core/xml/parser/frame.rb', line 254 def result @text.empty? ? nil : parse(@text.join) end |