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.
268 269 270 271 272 273 274 275 276 277 278 279 |
# File 'lib/aws-sdk-core/xml/parser/frame.rb', line 268 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.
265 266 267 |
# File 'lib/aws-sdk-core/xml/parser/frame.rb', line 265 def result @text.empty? ? nil : parse(@text.join) end |