Class: Stormpath::Rails::OrganizationForm
- Inherits:
-
Object
- Object
- Stormpath::Rails::OrganizationForm
- Defined in:
- app/forms/stormpath/rails/organization_form.rb
Defined Under Namespace
Classes: FormError
Instance Attribute Summary collapse
-
#name_key ⇒ Object
readonly
Returns the value of attribute name_key.
Instance Method Summary collapse
-
#initialize(name_key) ⇒ OrganizationForm
constructor
A new instance of OrganizationForm.
- #save! ⇒ Object
Constructor Details
#initialize(name_key) ⇒ OrganizationForm
Returns a new instance of OrganizationForm.
6 7 8 9 |
# File 'app/forms/stormpath/rails/organization_form.rb', line 6 def initialize(name_key) @name_key = name_key raise FormError, "Organization Name Key can't be blank" if name_key.blank? end |
Instance Attribute Details
#name_key ⇒ Object (readonly)
Returns the value of attribute name_key.
4 5 6 |
# File 'app/forms/stormpath/rails/organization_form.rb', line 4 def name_key @name_key end |
Instance Method Details
#save! ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'app/forms/stormpath/rails/organization_form.rb', line 17 def save! begin Stormpath::Rails::OrganizationResolver.new( OpenStruct.new(subdomains: [name_key]) ).organization rescue Stormpath::Rails::OrganizationResolver::Error raise FormError, 'Organization could not be found' end end |