Class: BigCheck::Client
- Inherits:
-
Object
- Object
- BigCheck::Client
- Defined in:
- lib/big_check/client.rb
Constant Summary collapse
- ENDPOINT =
'https://webservices.cibg.nl/Ribiz/OpenbaarV4.asmx?wsdl'
Instance Attribute Summary collapse
-
#classifications ⇒ Object
readonly
Returns the value of attribute classifications.
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#hcp ⇒ Object
readonly
Returns the value of attribute hcp.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
- #check_by_big(big_number) ⇒ Object
- #get_classifications ⇒ Object
-
#initialize ⇒ Client
constructor
A new instance of Client.
Constructor Details
Instance Attribute Details
#classifications ⇒ Object (readonly)
Returns the value of attribute classifications.
5 6 7 |
# File 'lib/big_check/client.rb', line 5 def classifications @classifications end |
#client ⇒ Object (readonly)
Returns the value of attribute client.
5 6 7 |
# File 'lib/big_check/client.rb', line 5 def client @client end |
#hcp ⇒ Object (readonly)
Returns the value of attribute hcp.
5 6 7 |
# File 'lib/big_check/client.rb', line 5 def hcp @hcp end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
5 6 7 |
# File 'lib/big_check/client.rb', line 5 def response @response end |
Instance Method Details
#check_by_big(big_number) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/big_check/client.rb', line 11 def check_by_big(big_number) = { "WebSite" => "Ribiz", "RegistrationNumber" => big_number } begin @response = @client.call(:list_hcp_approx4, message: ) fail unless @response.http.code == 200 @hcp = BigCheck::HCP.new(@response.body) return true rescue Savon::SOAPFault => e raise NotFoundError.new(e.) rescue Savon::HTTPError => e raise ServerNotFoundError.new(e.) rescue => e raise UnknownError.new(e.) end end |
#get_classifications ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/big_check/client.rb', line 30 def get_classifications begin @response = @client.call(:get_ribiz_reference_data) fail unless @response.http.code == 200 @classifications = BigCheck::Classifications.new(@response.body) rescue Savon::SOAPFault => e raise NotFoundError.new(e.) rescue Savon::HTTPError => e raise ServerNotFoundError.new(e.) rescue => e raise UnknownError.new(e.) end end |