Class: Stormpath::Rails::OrganizationResolver

Inherits:
Object
  • Object
show all
Defined in:
app/services/stormpath/rails/organization_resolver.rb

Defined Under Namespace

Classes: Error

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(request, organization_name_key = nil) ⇒ OrganizationResolver

Returns a new instance of OrganizationResolver.



6
7
8
9
# File 'app/services/stormpath/rails/organization_resolver.rb', line 6

def initialize(request, organization_name_key = nil)
  @subdomain_name = request.subdomains.first
  @organization_name_key = organization_name_key
end

Instance Attribute Details

#organization_name_keyObject (readonly)

Returns the value of attribute organization_name_key.



4
5
6
# File 'app/services/stormpath/rails/organization_resolver.rb', line 4

def organization_name_key
  @organization_name_key
end

#subdomain_nameObject (readonly)

Returns the value of attribute subdomain_name.



4
5
6
# File 'app/services/stormpath/rails/organization_resolver.rb', line 4

def subdomain_name
  @subdomain_name
end

Instance Method Details

#organizationObject



11
12
13
# File 'app/services/stormpath/rails/organization_resolver.rb', line 11

def organization
  find_organization(subdomain_name) || find_organization(organization_name_key) || raise_error
end