class Aws::EC2Metadata::Token

@api private

Attributes

value[R]
String

Returns the token value.

Public Class Methods

new(options = {}) click to toggle source
# File lib/aws-sdk-core/ec2_metadata.rb, line 223
def initialize(options = {})
  @ttl   = options[:ttl]
  @value = options[:value]
  @created_time = options[:created_time] || Time.now
end

Public Instance Methods

expired?() click to toggle source
Boolean

Returns true if the token expired.

# File lib/aws-sdk-core/ec2_metadata.rb, line 233
def expired?
  Time.now - @created_time > @ttl
end