Module: HerdstWorker::ExpiringCredentials

Defined in:
lib/herdst_worker/configuration/metadata.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#expiry_timestampObject

Returns the value of attribute expiry_timestamp.



11
12
13
# File 'lib/herdst_worker/configuration/metadata.rb', line 11

def expiry_timestamp
  @expiry_timestamp
end

Instance Method Details

#has_expired?Boolean

Returns:

  • (Boolean)


17
18
19
20
21
22
23
# File 'lib/herdst_worker/configuration/metadata.rb', line 17

def has_expired?
    if self.expiry_timestamp.nil?
        false
    else
        Time.now.utc.to_i > self.expiry_timestamp
    end
end

#set_expiry(expiry) ⇒ Object



13
14
15
# File 'lib/herdst_worker/configuration/metadata.rb', line 13

def set_expiry(expiry)
    self.expiry_timestamp = expiry
end