Class: Aws::EC2Metadata::Token Private
- Inherits:
- 
      Object
      
        - Object
- Aws::EC2Metadata::Token
 
- Defined in:
- lib/aws-sdk-core/ec2_metadata.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 collapse
- 
  
    
      #value  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  private
  
    - String
- 
Returns the token value. 
 
Instance Method Summary collapse
- 
  
    
      #expired?  ⇒ Boolean 
    
    
  
  
  
  
  
  
  
  private
  
    - Boolean
- 
Returns true if the token expired. 
 
- 
  
    
      #initialize(options = {})  ⇒ Token 
    
    
  
  
  
    constructor
  
  
  
  
  
  private
  
    A new instance of Token. 
Constructor Details
#initialize(options = {}) ⇒ Token
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.
Returns a new instance of Token.
| 223 224 225 226 227 | # File 'lib/aws-sdk-core/ec2_metadata.rb', line 223 def initialize( = {}) @ttl = [:ttl] @value = [:value] @created_time = [:created_time] || Time.now end | 
Instance Attribute Details
#value ⇒ Object (readonly)
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.
- String
- 
Returns the token value. 
| 230 231 232 | # File 'lib/aws-sdk-core/ec2_metadata.rb', line 230 def value @value end | 
Instance Method Details
#expired? ⇒ Boolean
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.
- Boolean
- 
Returns true if the token expired. 
| 233 234 235 | # File 'lib/aws-sdk-core/ec2_metadata.rb', line 233 def expired? Time.now - @created_time > @ttl end |