Skip to content

Commit

Permalink
Add ContactsService
Browse files Browse the repository at this point in the history
  • Loading branch information
weppos committed Jan 18, 2016
1 parent ae795bd commit 5b01dba
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/dnsimple/client/clients.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ def auth
@services[:auth] ||= Client::AuthService.new(self)
end

# @return [Dnsimple::Client::ContactsService] The contact-related API proxy.
def domains
@services[:domains] ||= Client::DomainsService.new(self)
end

# @return [Dnsimple::Client::DomainsService] The domain-related API proxy.
def domains
@services[:domains] ||= Client::DomainsService.new(self)
Expand Down Expand Up @@ -60,6 +65,13 @@ class AuthService < ClientService
end


require_relative 'contacts'

class ContactsService < ClientService
include Client::Contacts
end


require_relative 'domains'

class DomainsService < ClientService
Expand Down
6 changes: 6 additions & 0 deletions lib/dnsimple/client/contacts.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module Dnsimple
class Client
module Contacts
end
end
end
1 change: 1 addition & 0 deletions lib/dnsimple/struct.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ def initialize(attributes = {})
end

require_relative 'struct/account'
require_relative 'struct/contact'
require_relative 'struct/domain'
require_relative 'struct/record'
require_relative 'struct/user'
10 changes: 10 additions & 0 deletions lib/dnsimple/struct/contact.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module Dnsimple
module Struct

class Contact < Base
# @return [Fixnum] The contact ID in DNSimple.
attr_accessor :id
end

end
end
8 changes: 8 additions & 0 deletions spec/dnsimple/client/contacts_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
require 'spec_helper'

describe Dnsimple::Client, ".contacts" do

subject { described_class.new(api_endpoint: "https://api.dnsimple.test", access_token: "a1b2c3").contacts }


end

0 comments on commit 5b01dba

Please sign in to comment.