Class: Designate::Host

Inherits:
Client
  • Object
show all
Defined in:
lib/designate/host.rb

Constant Summary

Constants inherited from Client

Client::API_VERSION, Client::DOMAIN

Instance Method Summary collapse

Methods inherited from Client

#create_zone, #find_or_create_zone, #find_template_by_id, #find_zone_by_domain, #find_zone_by_id, #templates, #zones

Constructor Details

#initialize(data) ⇒ Host

Returns a new instance of Host.



4
5
6
7
8
9
10
11
# File 'lib/designate/host.rb', line 4

def initialize(data)
  data.each do |key, value|
    instance_variable_set("@#{key}", value)
    Host.instance_eval do
      attr_reader key.to_sym
    end
  end
end

Instance Method Details

#destroyObject



17
18
19
# File 'lib/designate/host.rb', line 17

def destroy
  delete("hosts/#{id}.xml")
end

#update(options = {}) ⇒ Object



13
14
15
# File 'lib/designate/host.rb', line 13

def update(options = {})
  put("hosts/#{id}.xml", { :host => options })
end