Class: MekariSso::RegisterCompany
- Inherits:
-
HttpRequest
- Object
- HttpRequest
- MekariSso::RegisterCompany
- Defined in:
- lib/requests/register_company.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Instance Method Summary collapse
- #headers_request ⇒ Object
-
#initialize(config, params) ⇒ RegisterCompany
constructor
A new instance of RegisterCompany.
- #send ⇒ Object
Methods inherited from HttpRequest
#after_error, #after_success, #handle_error, #handle_response, #headers, #original_response
Constructor Details
#initialize(config, params) ⇒ RegisterCompany
Returns a new instance of RegisterCompany.
11 12 13 14 |
# File 'lib/requests/register_company.rb', line 11 def initialize(config, params) @config = config @params = params end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
9 10 11 |
# File 'lib/requests/register_company.rb', line 9 def config @config end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
9 10 11 |
# File 'lib/requests/register_company.rb', line 9 def params @params end |
Instance Method Details
#headers_request ⇒ Object
35 36 37 38 39 40 |
# File 'lib/requests/register_company.rb', line 35 def headers_request headers.merge({ authorization: "Bearer #{@params.access_token}", accept_language: @config.accept_language }) end |
#send ⇒ Object
42 43 44 |
# File 'lib/requests/register_company.rb', line 42 def send RestClient.post "#{@config.base_url}/v1/companies", params, headers_request end |