class Stacktor::Identity::V2::Token

Public Instance Methods

endpoint_url_for_service_type(type, level=:public) click to toggle source
# File lib/stacktor/identity/v2/token.rb, line 24
def endpoint_url_for_service_type(type, level=:public)
  svc = self.data['access']['serviceCatalog'].select{|s| s['type'] == type}.first
  return nil if svc.nil?
  return svc['endpoints'][0]["#{level.to_s}URL"]
end
expired?() click to toggle source
# File lib/stacktor/identity/v2/token.rb, line 16
def expired?
  self.expires_at < Time.now
end
expires_at() click to toggle source
# File lib/stacktor/identity/v2/token.rb, line 12
def expires_at
  str = self.data["access"]["token"]["expires"]
  Time.parse(str)
end
id() click to toggle source
# File lib/stacktor/identity/v2/token.rb, line 9
def id
  self.data["access"]["token"]["id"]
end
valid?() click to toggle source
# File lib/stacktor/identity/v2/token.rb, line 20
def valid?
  !self.expired?
end