Class: AllscriptsUnityClient::ClientOptions
- Inherits:
-
Object
- Object
- AllscriptsUnityClient::ClientOptions
- Defined in:
- lib/allscripts_unity_client/client_options.rb
Instance Attribute Summary collapse
-
#appname ⇒ Object
Returns the value of attribute appname.
-
#base_unity_url ⇒ Object
Returns the value of attribute base_unity_url.
-
#ca_file ⇒ Object
Returns the value of attribute ca_file.
-
#ca_path ⇒ Object
Returns the value of attribute ca_path.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#new_relic ⇒ Object
Returns the value of attribute new_relic.
-
#password ⇒ Object
Returns the value of attribute password.
-
#proxy ⇒ Object
Returns the value of attribute proxy.
-
#timeout ⇒ Object
Returns the value of attribute timeout.
-
#timezone ⇒ Object
Returns the value of attribute timezone.
-
#username ⇒ Object
Returns the value of attribute username.
Instance Method Summary collapse
- #ca_file? ⇒ Boolean
- #ca_path? ⇒ Boolean
-
#initialize(options = {}) ⇒ ClientOptions
constructor
A new instance of ClientOptions.
- #logger? ⇒ Boolean
- #new_relic? ⇒ Boolean
- #proxy? ⇒ Boolean
- #timeout? ⇒ Boolean
- #validate_options(options = {}) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ ClientOptions
Returns a new instance of ClientOptions.
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/allscripts_unity_client/client_options.rb', line 6 def initialize( = {}) @username = [:username] @password = [:password] @appname = [:appname] @proxy = [:proxy] @logger = [:logger] @ca_file = [:ca_file] @ca_path = [:ca_path] @timeout = [:timeout] @new_relic = [:new_relic] self.timezone = [:timezone] self.base_unity_url = [:base_unity_url] end |
Instance Attribute Details
#appname ⇒ Object
Returns the value of attribute appname.
4 5 6 |
# File 'lib/allscripts_unity_client/client_options.rb', line 4 def appname @appname end |
#base_unity_url ⇒ Object
Returns the value of attribute base_unity_url.
4 5 6 |
# File 'lib/allscripts_unity_client/client_options.rb', line 4 def base_unity_url @base_unity_url end |
#ca_file ⇒ Object
Returns the value of attribute ca_file.
3 4 5 |
# File 'lib/allscripts_unity_client/client_options.rb', line 3 def ca_file @ca_file end |
#ca_path ⇒ Object
Returns the value of attribute ca_path.
3 4 5 |
# File 'lib/allscripts_unity_client/client_options.rb', line 3 def ca_path @ca_path end |
#logger ⇒ Object
Returns the value of attribute logger.
3 4 5 |
# File 'lib/allscripts_unity_client/client_options.rb', line 3 def logger @logger end |
#new_relic ⇒ Object
Returns the value of attribute new_relic.
3 4 5 |
# File 'lib/allscripts_unity_client/client_options.rb', line 3 def new_relic @new_relic end |
#password ⇒ Object
Returns the value of attribute password.
4 5 6 |
# File 'lib/allscripts_unity_client/client_options.rb', line 4 def password @password end |
#proxy ⇒ Object
Returns the value of attribute proxy.
3 4 5 |
# File 'lib/allscripts_unity_client/client_options.rb', line 3 def proxy @proxy end |
#timeout ⇒ Object
Returns the value of attribute timeout.
3 4 5 |
# File 'lib/allscripts_unity_client/client_options.rb', line 3 def timeout @timeout end |
#timezone ⇒ Object
Returns the value of attribute timezone.
4 5 6 |
# File 'lib/allscripts_unity_client/client_options.rb', line 4 def timezone @timezone end |
#username ⇒ Object
Returns the value of attribute username.
4 5 6 |
# File 'lib/allscripts_unity_client/client_options.rb', line 4 def username @username end |
Instance Method Details
#ca_file? ⇒ Boolean
71 72 73 |
# File 'lib/allscripts_unity_client/client_options.rb', line 71 def ca_file? !@ca_file.to_s.strip.empty? end |
#ca_path? ⇒ Boolean
75 76 77 |
# File 'lib/allscripts_unity_client/client_options.rb', line 75 def ca_path? !@ca_path.to_s.strip.empty? end |
#logger? ⇒ Boolean
67 68 69 |
# File 'lib/allscripts_unity_client/client_options.rb', line 67 def logger? !@logger.nil? end |
#new_relic? ⇒ Boolean
83 84 85 |
# File 'lib/allscripts_unity_client/client_options.rb', line 83 def new_relic? !@new_relic.nil? end |
#proxy? ⇒ Boolean
63 64 65 |
# File 'lib/allscripts_unity_client/client_options.rb', line 63 def proxy? !@proxy.to_s.strip.empty? end |
#timeout? ⇒ Boolean
79 80 81 |
# File 'lib/allscripts_unity_client/client_options.rb', line 79 def timeout? !@timeout.to_s.strip.empty? end |
#validate_options(options = {}) ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/allscripts_unity_client/client_options.rb', line 23 def ( = {}) base_unity_url = .has_key?(:base_unity_url) ? [:base_unity_url] : @base_unity_url username = .has_key?(:username) ? [:username] : @username password = .has_key?(:password) ? [:password] : @password appname = .has_key?(:appname) ? [:appname] : @appname raise ArgumentError, 'base_unity_url can not be nil' if base_unity_url.nil? raise ArgumentError, 'username can not be nil' if username.nil? raise ArgumentError, 'password can not be nil' if password.nil? raise ArgumentError, 'appname can not be nil' if appname.nil? end |