Class: Barge::Resource::Domain

Inherits:
Object
  • Object
show all
Includes:
Base
Defined in:
lib/barge/resource/domain.rb

Constant Summary

Constants included from Base

Base::PER_PAGE

Instance Attribute Summary

Attributes included from Base

#faraday

Instance Method Summary collapse

Methods included from Base

#initialize

Instance Method Details

#all(options = {}) ⇒ Object



10
11
12
# File 'lib/barge/resource/domain.rb', line 10

def all(options = {})
  get('domains', options)
end

#create(options) ⇒ Object



6
7
8
# File 'lib/barge/resource/domain.rb', line 6

def create(options)
  post('domains', options.to_json)
end

#create_record(domain_name, options) ⇒ Object



22
23
24
# File 'lib/barge/resource/domain.rb', line 22

def create_record(domain_name, options)
  post("domains/#{domain_name}/records", options.to_json)
end

#destroy(domain_name) ⇒ Object



18
19
20
# File 'lib/barge/resource/domain.rb', line 18

def destroy(domain_name)
  delete("domains/#{domain_name}")
end

#destroy_record(domain_name, record_id) ⇒ Object



38
39
40
# File 'lib/barge/resource/domain.rb', line 38

def destroy_record(domain_name, record_id)
  delete("domains/#{domain_name}/records/#{record_id}")
end

#records(domain_name, options = {}) ⇒ Object



26
27
28
# File 'lib/barge/resource/domain.rb', line 26

def records(domain_name, options = {})
  get("domains/#{domain_name}/records", options)
end

#show(domain_name) ⇒ Object



14
15
16
# File 'lib/barge/resource/domain.rb', line 14

def show(domain_name)
  get("domains/#{domain_name}")
end

#show_record(domain_name, record_id) ⇒ Object



30
31
32
# File 'lib/barge/resource/domain.rb', line 30

def show_record(domain_name, record_id)
  get("domains/#{domain_name}/records/#{record_id}")
end

#update_record(domain_name, record_id, options) ⇒ Object



34
35
36
# File 'lib/barge/resource/domain.rb', line 34

def update_record(domain_name, record_id, options)
  put("domains/#{domain_name}/records/#{record_id}", options.to_json)
end