Method: Dnsruby::RR.create
- Defined in:
- lib/dnsruby/resource/RR.rb
.create(*args) ⇒ Object
Create a new RR from the arguments, which can be either a String or a Hash. See new_from_string and new_from_hash for details
a = Dnsruby::RR.create('foo.example.com. 86400 A 10.1.2.3')
mx = Dnsruby::RR.create('example.com. 7200 MX 10 mailhost.example.com.')
cname = Dnsruby::RR.create('www.example.com 300 IN CNAME www1.example.com')
txt = Dnsruby::RR.create('baz.example.com 3600 HS TXT 'text record'')
rr = Dnsruby::RR.create({:name => 'example.com'})
rr = Dnsruby::RR.create({:name => 'example.com', :type => 'MX', :ttl => 10,
:preference => 5, :exchange => 'mx1.example.com'})
399 400 401 402 403 404 405 406 407 408 |
# File 'lib/dnsruby/resource/RR.rb', line 399 def RR.create(*args) case args[0] when String new_from_string(args[0]) when Hash new_from_hash(args[0]) else new_from_data(args) end end |