Class: Lumberg::Cpanel::RandomData

Inherits:
Base show all
Defined in:
lib/lumberg/cpanel/random_data.rb

Overview

Public: Allows you to create random data

Instance Attribute Summary

Attributes inherited from Base

#api_username

Attributes inherited from Whm::Base

#server

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#initialize, #perform_request

Methods inherited from Whm::Base

#initialize, #setup_server

Constructor Details

This class inherits a constructor from Lumberg::Cpanel::Base

Class Method Details

.api_moduleObject


5
# File 'lib/lumberg/cpanel/random_data.rb', line 5

def self.api_module; "Rand" ; end

Instance Method Details

#show(options = {}) ⇒ Object

Public: Retrieve a random string

options - Hash options for API call params (default: {})

:length - Integer length of the random string you wish to receive

Examples

api_args = { host: "x.x.x.x", hash: "pass", api_username: "user" }
random_data = Lumberg::Cpanel::RandomData.new(api_args.dup)

random_data.show

Returns Hash API response


19
20
21
# File 'lib/lumberg/cpanel/random_data.rb', line 19

def show(options = {})
  perform_request({ api_function: 'getranddata' }.merge(options))
end