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.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#password ⇒ Object
Returns the value of attribute password.
-
#proxy ⇒ Object
Returns the value of attribute proxy.
-
#timezone ⇒ Object
Returns the value of attribute timezone.
-
#username ⇒ Object
Returns the value of attribute username.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ ClientOptions
constructor
A new instance of ClientOptions.
- #logger? ⇒ Boolean
- #proxy? ⇒ 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 |
# File 'lib/allscripts_unity_client/client_options.rb', line 6 def initialize( = {}) @base_unity_url = [:base_unity_url] ? [:base_unity_url].gsub(/\/$/, '') : nil @username = [:username] @password = [:password] @appname = [:appname] @proxy = [:proxy] self.timezone = [:timezone] @logger = [:logger] 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 |
#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 |
#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 |
#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
#logger? ⇒ Boolean
64 65 66 |
# File 'lib/allscripts_unity_client/client_options.rb', line 64 def logger? !@logger.nil? end |
#proxy? ⇒ Boolean
58 59 60 61 62 |
# File 'lib/allscripts_unity_client/client_options.rb', line 58 def proxy? return false if @proxy.nil? return false if @proxy.empty? true end |
#validate_options(options = {}) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/allscripts_unity_client/client_options.rb', line 18 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 |