Class: MekariSso::CompanyRegister

Inherits:
Config
  • Object
show all
Defined in:
lib/params/company_register.rb

Direct Known Subclasses

CompanyUpdate

Instance Attribute Summary collapse

Attributes inherited from Config

#accept_language, #base_url, #client_id, #client_secret

Instance Method Summary collapse

Methods inherited from Config

#apply

Constructor Details

#initialize(options = nil) ⇒ CompanyRegister

Returns a new instance of CompanyRegister.



10
11
12
# File 'lib/params/company_register.rb', line 10

def initialize(options = nil)
  apply(options) if options
end

Instance Attribute Details

#access_tokenObject

Returns the value of attribute access_token.



7
8
9
# File 'lib/params/company_register.rb', line 7

def access_token
  @access_token
end

#billing_emailObject

Returns the value of attribute billing_email.



7
8
9
# File 'lib/params/company_register.rb', line 7

def billing_email
  @billing_email
end

#billing_nameObject

Returns the value of attribute billing_name.



7
8
9
# File 'lib/params/company_register.rb', line 7

def billing_name
  @billing_name
end

#billing_phoneObject

Returns the value of attribute billing_phone.



7
8
9
# File 'lib/params/company_register.rb', line 7

def billing_phone
  @billing_phone
end

#brand_nameObject

Returns the value of attribute brand_name.



7
8
9
# File 'lib/params/company_register.rb', line 7

def brand_name
  @brand_name
end

#emailObject

Returns the value of attribute email.



7
8
9
# File 'lib/params/company_register.rb', line 7

def email
  @email
end

#industry_idObject

Returns the value of attribute industry_id.



7
8
9
# File 'lib/params/company_register.rb', line 7

def industry_id
  @industry_id
end

#industry_nameObject

Returns the value of attribute industry_name.



7
8
9
# File 'lib/params/company_register.rb', line 7

def industry_name
  @industry_name
end

#main_addressObject

Returns the value of attribute main_address.



7
8
9
# File 'lib/params/company_register.rb', line 7

def main_address
  @main_address
end

#nameObject

Returns the value of attribute name.



7
8
9
# File 'lib/params/company_register.rb', line 7

def name
  @name
end

#phoneObject

Returns the value of attribute phone.



7
8
9
# File 'lib/params/company_register.rb', line 7

def phone
  @phone
end

#secondary_addressObject

Returns the value of attribute secondary_address.



7
8
9
# File 'lib/params/company_register.rb', line 7

def secondary_address
  @secondary_address
end

#tax_nameObject

Returns the value of attribute tax_name.



7
8
9
# File 'lib/params/company_register.rb', line 7

def tax_name
  @tax_name
end

#tax_numberObject

Returns the value of attribute tax_number.



7
8
9
# File 'lib/params/company_register.rb', line 7

def tax_number
  @tax_number
end

#user_idObject

Returns the value of attribute user_id.



7
8
9
# File 'lib/params/company_register.rb', line 7

def user_id
  @user_id
end

Instance Method Details

#available_keysObject



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/params/company_register.rb', line 14

def available_keys
  i[
    access_token
    name
    email
    industry_id
    industry_name
    user_id
    brand_name
    main_address
    secondary_address
    phone
    tax_name
    tax_number
    billing_name
    billing_email
    billing_phone
  ]
end

#validate_required!Object



34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/params/company_register.rb', line 34

def validate_required!
  unless @name.present?
    raise ArgumentError, "Params name is required options"
  end

  unless @email.present?
    raise ArgumentError, "Params email is required options"
  end

  unless @user_id.present?
    raise ArgumentError, "Params user_id is required options"
  end
end