Sha256: bec64ac3f4cbbde36b7a22d61060e90463761f7a4bfd0c8a16d1941a01d69821

Contents?: true

Size: 604 Bytes

Versions: 10

Compression:

Stored size: 604 Bytes

Contents

module DNSimple
  module Commands
    class RegisterDomain
      def execute(args, options={})
        name = args.shift
        registrant = {:id => args.shift}

        extended_attributes = {}
        args.each do |arg|
          n, v = arg.split(":")
          extended_attributes[n] = v
        end

        domain = Domain.register(name, registrant, extended_attributes)
        puts "Registered #{domain.name}"

        if template = options.delete(:template)
          domain.apply(template)
          puts "Applied template #{template} to #{domain.name}"
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
dnsimple-ruby-0.9.5 lib/dnsimple/commands/register_domain.rb
dnsimple-ruby-0.9.4 lib/dnsimple/commands/register_domain.rb
dnsimple-ruby-0.9.3 lib/dnsimple/commands/register_domain.rb
dnsimple-ruby-0.9.2 lib/dnsimple/commands/register_domain.rb
dnsimple-ruby-0.9.1 lib/dnsimple/commands/register_domain.rb
dnsimple-ruby-0.9.0 lib/dnsimple/commands/register_domain.rb
dnsimple-ruby-0.8.4 lib/dnsimple/commands/register_domain.rb
dnsimple-ruby-0.8.3 lib/dnsimple/commands/register_domain.rb
dnsimple-ruby-0.8.2 lib/dnsimple/commands/register_domain.rb
dnsimple-ruby-0.8.0 lib/dnsimple/commands/register_domain.rb