Class: Stormpath::Rails::OrganizationResolver
- Inherits:
-
Object
- Object
- Stormpath::Rails::OrganizationResolver
- Defined in:
- app/services/stormpath/rails/organization_resolver.rb
Defined Under Namespace
Classes: Error
Instance Attribute Summary collapse
-
#organization_name_key ⇒ Object
readonly
Returns the value of attribute organization_name_key.
-
#subdomain_name ⇒ Object
readonly
Returns the value of attribute subdomain_name.
Instance Method Summary collapse
-
#initialize(request, organization_name_key = nil) ⇒ OrganizationResolver
constructor
A new instance of OrganizationResolver.
- #organization ⇒ Object
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_key ⇒ Object (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_name ⇒ Object (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
#organization ⇒ Object
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 |