Class: Netscaler::Configuration
- Inherits:
-
Object
- Object
- Netscaler::Configuration
- Defined in:
- lib/netscaler/config.rb
Instance Attribute Summary collapse
-
#alias ⇒ Object
readonly
Returns the value of attribute alias.
-
#host ⇒ Object
readonly
Returns the value of attribute host.
-
#password ⇒ Object
readonly
Returns the value of attribute password.
-
#username ⇒ Object
readonly
Returns the value of attribute username.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
-
#initialize(host, username, password = nil, nalias = nil, version = nil) ⇒ Configuration
constructor
A new instance of Configuration.
- #query_password ⇒ Object
Constructor Details
#initialize(host, username, password = nil, nalias = nil, version = nil) ⇒ Configuration
Returns a new instance of Configuration.
65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/netscaler/config.rb', line 65 def initialize(host, username, password=nil, nalias=nil, version=nil) @host = host @username = username @password = password @alias = nalias @version = if version version.to_s else "9.2" end query_password end |
Instance Attribute Details
#alias ⇒ Object (readonly)
Returns the value of attribute alias.
63 64 65 |
# File 'lib/netscaler/config.rb', line 63 def alias @alias end |
#host ⇒ Object (readonly)
Returns the value of attribute host.
63 64 65 |
# File 'lib/netscaler/config.rb', line 63 def host @host end |
#password ⇒ Object (readonly)
Returns the value of attribute password.
63 64 65 |
# File 'lib/netscaler/config.rb', line 63 def password @password end |
#username ⇒ Object (readonly)
Returns the value of attribute username.
63 64 65 |
# File 'lib/netscaler/config.rb', line 63 def username @username end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
63 64 65 |
# File 'lib/netscaler/config.rb', line 63 def version @version end |
Instance Method Details
#query_password ⇒ Object
79 80 81 82 83 84 85 86 87 |
# File 'lib/netscaler/config.rb', line 79 def query_password if password.nil? @password = ask("Netscaler password for host #{host}: ") {|q| q.echo = false } end if password.nil? || password.empty? raise Netscaler::ConfigurationError.new("Unable to read the Netscaler password.") end end |