Class: Kloxo::API::Client::Create

Inherits:
Request
  • Object
show all
Defined in:
lib/kloxo/api/client/create.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ Create

Returns a new instance of Create.



7
8
9
10
11
12
13
14
# File 'lib/kloxo/api/client/create.rb', line 7

def initialize params = {}
  self.name = params[:name]
  self.password = params[:password]
  self.plan = params[:plan]
  self.email = params[:email]
  self.domain = params[:domain]
  self.dns_template = params[:dns_template]
end

Instance Attribute Details

#dns_templateObject

Returns the value of attribute dns_template.



5
6
7
# File 'lib/kloxo/api/client/create.rb', line 5

def dns_template
  @dns_template
end

#domainObject

Returns the value of attribute domain.



5
6
7
# File 'lib/kloxo/api/client/create.rb', line 5

def domain
  @domain
end

#emailObject

Returns the value of attribute email.



5
6
7
# File 'lib/kloxo/api/client/create.rb', line 5

def email
  @email
end

#nameObject

Returns the value of attribute name.



5
6
7
# File 'lib/kloxo/api/client/create.rb', line 5

def name
  @name
end

#passwordObject

Returns the value of attribute password.



5
6
7
# File 'lib/kloxo/api/client/create.rb', line 5

def password
  @password
end

#planObject

Returns the value of attribute plan.



5
6
7
# File 'lib/kloxo/api/client/create.rb', line 5

def plan
  @plan
end

Instance Method Details

#paramObject



16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/kloxo/api/client/create.rb', line 16

def param
  {
    "action" => "add",
    "class" => "client",
    "name" => self.name,
    "v-plan_name" => self.plan,
    "v-type" => "customer",
    "v-contactemail" => self.email,
    "v-password" => self.password,
    "v-send_welcome_f" => "on",
    "v-domain_name" => self.domain,
    "v-dnstemplate_name" => self.dns_template
  }.to_param
end