Class: Dhis2::Configuration
- Inherits:
-
Object
- Object
- Dhis2::Configuration
- Defined in:
- lib/dhis2/configuration.rb
Constant Summary collapse
- ALLOWED_VERSIONS =
%w(2.24 2.25 2.26 2.27 2.28).freeze
Instance Attribute Summary collapse
-
#debug ⇒ Object
Returns the value of attribute debug.
-
#no_ssl_verification ⇒ Object
Returns the value of attribute no_ssl_verification.
-
#password ⇒ Object
Returns the value of attribute password.
-
#timeout ⇒ Object
Returns the value of attribute timeout.
-
#url ⇒ Object
Returns the value of attribute url.
-
#user ⇒ Object
Returns the value of attribute user.
Instance Method Summary collapse
Instance Attribute Details
#debug ⇒ Object
Returns the value of attribute debug.
7 8 9 |
# File 'lib/dhis2/configuration.rb', line 7 def debug @debug end |
#no_ssl_verification ⇒ Object
Returns the value of attribute no_ssl_verification.
7 8 9 |
# File 'lib/dhis2/configuration.rb', line 7 def no_ssl_verification @no_ssl_verification end |
#password ⇒ Object
Returns the value of attribute password.
7 8 9 |
# File 'lib/dhis2/configuration.rb', line 7 def password @password end |
#timeout ⇒ Object
Returns the value of attribute timeout.
7 8 9 |
# File 'lib/dhis2/configuration.rb', line 7 def timeout @timeout end |
#url ⇒ Object
Returns the value of attribute url.
7 8 9 |
# File 'lib/dhis2/configuration.rb', line 7 def url @url end |
#user ⇒ Object
Returns the value of attribute user.
7 8 9 |
# File 'lib/dhis2/configuration.rb', line 7 def user @user end |
Instance Method Details
#client_params ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/dhis2/configuration.rb', line 9 def client_params { url: no_credentials? ? url : build_url, debug: debug, version: version, timeout: timeout, verify_ssl: verify_ssl } end |
#play_params(with_debug, version) ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/dhis2/configuration.rb', line 19 def play_params(with_debug, version) { url: "https://admin:[email protected]/#{version}/", debug: with_debug, version: version } end |
#version=(version) ⇒ Object
27 28 29 30 |
# File 'lib/dhis2/configuration.rb', line 27 def version=(version) raise Dhis2::InvalidVersionError, version.to_s unless ALLOWED_VERSIONS.include?(version) @version = version end |