Class: Lockstep::MagicLink

Inherits:
ApiRecord show all
Defined in:
app/models/lockstep/magic_link.rb

Constant Summary

Constants inherited from ApiRecord

ApiRecord::HashWithIndifferentAccess

Instance Attribute Summary

Attributes inherited from ApiRecord

#error_instances

Class Method Summary collapse

Methods inherited from ApiRecord

#==, #_read_attribute, additional_query_params, alias_attribute, #as_json, #attributes, #attributes=, #attributes_for_saving, belongs_to, #belongs_to_relations, belongs_to_relations, bulk_import, chunk, class_attributes, #clean?, config, #create, create, #create_getters!, #create_setters!, #create_setters_and_getters!, #created_at, #destroy, destroy_all, #dirty?, enum, enum_config, #enum_config, execute, field, fields, find, find_by, #get_attribute, has_many, #has_many_relations, has_many_relations, #id, #id_ref, included, #initialize, #instance_resource, #load_association, load_schema, lockstep_belongs_to_relations, lockstep_has_many_relations, merge_all_attributes, #merge_attributes, #merge_relations, #method_missing, method_missing, #model_base_uri, model_base_uri, #new?, #objectId, #persisted?, #pointerize, #post_result, #primary_key, primary_key, #relations_for_saving, #reload, #resource, resource, #save, schema, #schema, #set_attribute, single_record!, to_date_object, #to_json, #to_pointer, #update, #update_attribute, #update_attributes, #updated_at, valid_attribute?, #validate_enum, where

Methods included from QueryMethods

included

Constructor Details

This class inherits a constructor from Lockstep::ApiRecord

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Lockstep::ApiRecord

Class Method Details

.generate(email_id, expiry, app_id, user_role, company_id, accounting_profile_id) ⇒ Object



7
8
9
10
11
12
13
14
15
# File 'app/models/lockstep/magic_link.rb', line 7

def self.generate(email_id, expiry, app_id, user_role, company_id, accounting_profile_id)
  body = { email: email_id,
    expiresInMinutes: expiry, applicationId: app_id,
    userRole: user_role, companyId: company_id,
    accountingProfileId: accounting_profile_id }
  body = body.compact

  resource.post_magic_link('', body: body, params: {})
end