Class: LetsencryptWebfaction::WebfactionApiCredentials
- Inherits:
-
Object
- Object
- LetsencryptWebfaction::WebfactionApiCredentials
- Defined in:
- lib/letsencrypt_webfaction/webfaction_api_credentials.rb
Constant Summary collapse
- WEBFACTION_API_VERSION =
2
Instance Attribute Summary collapse
-
#api_server ⇒ Object
readonly
Returns the value of attribute api_server.
-
#password ⇒ Object
readonly
Returns the value of attribute password.
-
#servername ⇒ Object
readonly
Returns the value of attribute servername.
-
#username ⇒ Object
readonly
Returns the value of attribute username.
Instance Method Summary collapse
- #call(action, *args) ⇒ Object
-
#initialize(username:, password:, servername:, api_server:) ⇒ WebfactionApiCredentials
constructor
A new instance of WebfactionApiCredentials.
- #valid? ⇒ Boolean
Constructor Details
#initialize(username:, password:, servername:, api_server:) ⇒ WebfactionApiCredentials
Returns a new instance of WebfactionApiCredentials.
12 13 14 15 16 17 |
# File 'lib/letsencrypt_webfaction/webfaction_api_credentials.rb', line 12 def initialize(username:, password:, servername:, api_server:) @username = username @password = password @servername = servername @api_server = api_server end |
Instance Attribute Details
#api_server ⇒ Object (readonly)
Returns the value of attribute api_server.
10 11 12 |
# File 'lib/letsencrypt_webfaction/webfaction_api_credentials.rb', line 10 def api_server @api_server end |
#password ⇒ Object (readonly)
Returns the value of attribute password.
8 9 10 |
# File 'lib/letsencrypt_webfaction/webfaction_api_credentials.rb', line 8 def password @password end |
#servername ⇒ Object (readonly)
Returns the value of attribute servername.
9 10 11 |
# File 'lib/letsencrypt_webfaction/webfaction_api_credentials.rb', line 9 def servername @servername end |
#username ⇒ Object (readonly)
Returns the value of attribute username.
7 8 9 |
# File 'lib/letsencrypt_webfaction/webfaction_api_credentials.rb', line 7 def username @username end |
Instance Method Details
#call(action, *args) ⇒ Object
19 20 21 |
# File 'lib/letsencrypt_webfaction/webfaction_api_credentials.rb', line 19 def call(action, *args) server_client.call(action, session_id, *args) end |
#valid? ⇒ Boolean
23 24 25 26 27 28 29 |
# File 'lib/letsencrypt_webfaction/webfaction_api_credentials.rb', line 23 def valid? !session_id.nil? rescue XMLRPC::FaultException => e return false if e. == 'LoginError' raise end |