Giter Club home page Giter Club logo

Comments (7)

geoffgarside avatar geoffgarside commented on September 16, 2024

Hi,
Sorry the interface has been overhauled for 1.0.0 and I've neglected to update the README file. While I get something together to document the updated interface you can check the tests to see how the different types of requests can be created now.

from epp-client.

Tombar avatar Tombar commented on September 16, 2024

Ok, thanks for your quick response.

Could you provide just a brief working example of checking a domain availability.

Regards

M

from epp-client.

geoffgarside avatar geoffgarside commented on September 16, 2024

I've pushed up a quick set of examples in the README file

resp = client.check EPP::Domain::Check.new('example.com', 'example.net', 'example.org')
resp.available?('example.com') #=> true
resp.available?('example.net') #=> false
resp.available?('example.org') #=> false

if you've only got one name you want to check then you can use

resp = client.check EPP::Domain::Check.new('example.com')
resp.available? #=> true

as you don't have to pass the name to the #available? method when theres only one item being checked.

from epp-client.

Tombar avatar Tombar commented on September 16, 2024

Thank you very much!

from epp-client.

Tombar avatar Tombar commented on September 16, 2024

@geoffgarside sorry to bother you again, but your example is just partially working for me..

The check is working, but the resp.available? isn't.

My code

require "epp-client"

client = EPP::Client.new('user', 'pass', 'host', { :port => 1234} )
client.hello
resp = client.check EPP::Domain::Check.new('example.com', 'example.org')
puts resp.class
resp.available?('example.com') 

My output

EPP::Response
new.rb:7:in `<main>': undefined method `available?' for #<EPP::Response:0x00000001f00220> (NoMethodError)

It's looks to me, like the client.check response is of type EPP::Response instead of EPP::Domain::CheckResponse, am I doing something really stupid or missing something?

FTR, gem epp-client installed is version 1.0.0

Regards

M

from epp-client.

geoffgarside avatar geoffgarside commented on September 16, 2024

Damn,
Most of my use of this code is in m247/nominet-epp so I'd forgotten how low the interface was with this. The interface was quite influenced by the needs for testing the generated XML.

I've updated the README. I'd forgotten that you need to pass the EPP::Response to something like EPP::Domain::CheckResponse.new. It makes me think that it might be worth adding another method to the likes of EPP::Domain::Check where it can specify the response class to use.

from epp-client.

Tombar avatar Tombar commented on September 16, 2024

I've just see how you guys do it on the nominet-epp., I will try to backport the logic into the epp-client and send a pull request.

I'll let you know if I need some help with the test cases.

Thanks for all your help Sir!

Regards

M

from epp-client.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.