Module: Misty::Auth::Domain

Included in:
ProjectScope, User
Defined in:
lib/misty/auth/name.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#domainObject

Returns the value of attribute domain.



4
5
6
# File 'lib/misty/auth/name.rb', line 4

def domain
  @domain
end

Instance Method Details

#identityObject



6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/misty/auth/name.rb', line 6

def identity
  data = {}
  if !id.nil?
    data.merge!(to_h(:id))
  elsif !name.nil? && !domain.nil?
    data.merge!(to_h(:name))
    data.merge!({ :domain => @domain.identity })
  else
    raise Misty::Auth::CredentialsError, "#{self.class}: An Id, or a name with its domain, must be provided"
  end
  data
end