class Firmapi::Company
Public Class Methods
find_by_siren!(siren)
click to toggle source
# File lib/firmapi/company.rb, line 24 def self.find_by_siren!(siren) response = API.new.get '/company', { siren: siren } if response.status == 200 json = response.body self.new(json["result"]) elsif response.status == 404 raise NoCompanyFound, "No company was found with the siren '#{siren}'." end end