Class: PleskLib::Server
- Inherits:
-
Object
- Object
- PleskLib::Server
- Defined in:
- lib/plesk_lib/server.rb
Instance Attribute Summary collapse
-
#host ⇒ Object
Returns the value of attribute host.
-
#password ⇒ Object
Returns the value of attribute password.
-
#username ⇒ Object
Returns the value of attribute username.
Instance Method Summary collapse
-
#initialize(host, username, password) ⇒ Server
constructor
A new instance of Server.
- #method_missing(method_name, *args) ⇒ Object
Constructor Details
#initialize(host, username, password) ⇒ Server
Returns a new instance of Server.
5 6 7 8 9 |
# File 'lib/plesk_lib/server.rb', line 5 def initialize(host, username, password) @host = host @username = username @password = password end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *args) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/plesk_lib/server.rb', line 11 def method_missing(method_name, *args) begin action_class = "PleskLib::Actions::#{method_name.to_s.camelize}".constantize rescue NameError => e raise NoMethodError, "The Action #{e.name} is not available. Please check the action docs." else action = action_class.new(*args) action.execute_on(self) return action end end |
Instance Attribute Details
#host ⇒ Object
Returns the value of attribute host.
3 4 5 |
# File 'lib/plesk_lib/server.rb', line 3 def host @host end |
#password ⇒ Object
Returns the value of attribute password.
3 4 5 |
# File 'lib/plesk_lib/server.rb', line 3 def password @password end |
#username ⇒ Object
Returns the value of attribute username.
3 4 5 |
# File 'lib/plesk_lib/server.rb', line 3 def username @username end |