Class: SimplyAuth::SignupForm
- Defined in:
- app/models/simply_auth/signup_form.rb
Instance Attribute Summary collapse
-
#application_id ⇒ Object
Returns the value of attribute application_id.
-
#name ⇒ Object
Returns the value of attribute name.
-
#steps ⇒ Object
Returns the value of attribute steps.
Attributes inherited from Model
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Model
#attributes=, collection_path, #collection_path, create, #data, #data=, find, #initialize, instance_path, #instance_path, owner_class, path_component, #persisted=, #persisted?, #save
Constructor Details
This class inherits a constructor from SimplyAuth::Model
Instance Attribute Details
#application_id ⇒ Object
Returns the value of attribute application_id.
3 4 5 |
# File 'app/models/simply_auth/signup_form.rb', line 3 def application_id @application_id end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'app/models/simply_auth/signup_form.rb', line 3 def name @name end |
#steps ⇒ Object
Returns the value of attribute steps.
3 4 5 |
# File 'app/models/simply_auth/signup_form.rb', line 3 def steps @steps end |
Class Method Details
.all(ids) ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 |
# File 'app/models/simply_auth/signup_form.rb', line 25 def self.all(ids) response = RestClient.get( "https://api.simplyauth.com#{collection_path(ids)}", accept: :json ) body = JSON.parse(response.body)[model_name.element.pluralize.camelize(:lower)] body.map do |data| data = data.deep_transform_keys { |key| key.to_s.underscore } new(data) end end |
.owner_class_name ⇒ Object
14 15 16 |
# File 'app/models/simply_auth/signup_form.rb', line 14 def self.owner_class_name "Application" end |
Instance Method Details
#attributes ⇒ Object
6 7 8 |
# File 'app/models/simply_auth/signup_form.rb', line 6 def attributes super.merge(name: name, steps: steps) end |
#destroy ⇒ Object
18 19 20 21 22 23 |
# File 'app/models/simply_auth/signup_form.rb', line 18 def destroy response = RestClient.delete( "https://api.simplyauth.com#{instance_path}", accept: :json ) end |
#owner_id ⇒ Object
10 11 12 |
# File 'app/models/simply_auth/signup_form.rb', line 10 def owner_id self.application_id end |