Class: Apis::Companies

Inherits:
Object
  • Object
show all
Defined in:
lib/apis/endpoints/companies.rb

Overview

Class to fetch companies

Instance Method Summary collapse

Instance Method Details

#by_address(address) ⇒ Faraday::Response

Search the icelandic company registry by address

Parameters:

  • address (String)

    company address (required)

Returns:

  • (Faraday::Response)

    Api result.



18
19
20
# File 'lib/apis/endpoints/companies.rb', line 18

def by_address(address)
  Apis.client.get("/company?address=#{address}")
end

#by_name(name) ⇒ Faraday::Response

Search the icelandic company registry by name

Parameters:

  • name (String)

    company name (required)

Returns:

  • (Faraday::Response)

    Api result.



10
11
12
# File 'lib/apis/endpoints/companies.rb', line 10

def by_name(name)
  Apis.client.get("/company?name=#{name}")
end

#by_sn(socialnumber) ⇒ Faraday::Response

Search the icelandic company registry by social number

Parameters:

  • socialnumber (String)

    company socialnumber (required)

Returns:

  • (Faraday::Response)

    Api result.



26
27
28
# File 'lib/apis/endpoints/companies.rb', line 26

def by_sn(socialnumber)
  Apis.client.get("/company?socialnumber=#{socialnumber}")
end

#by_vsknr(vsknr) ⇒ Faraday::Response

Search the icelandic company registry by vsk number

Parameters:

  • vsknr (String)

    company vsknumer (required)

Returns:

  • (Faraday::Response)

    Api result.



34
35
36
# File 'lib/apis/endpoints/companies.rb', line 34

def by_vsknr(vsknr)
  Apis.client.get("/company?vsknr=#{vsknr}")
end