Module: ISMS::Configuration
- Included in:
- ISMS
- Defined in:
- lib/isms/configuration.rb
Constant Summary collapse
- DEFAULT_PROTOCOL =
'http'
- DEFAULT_ENDPOINT =
'www.isms.com.my'
- DEFAULT_USERNAME =
nil
- DEFAULT_PASSWORD =
nil
Instance Attribute Summary collapse
-
#endpoint ⇒ Object
Returns the value of attribute endpoint.
-
#password ⇒ Object
Returns the value of attribute password.
-
#protocol ⇒ Object
Returns the value of attribute protocol.
-
#username ⇒ Object
Returns the value of attribute username.
Class Method Summary collapse
-
.extended(mod) ⇒ Object
When extended, call reset to set variable values to defaults.
Instance Method Summary collapse
Instance Attribute Details
#endpoint ⇒ Object
Returns the value of attribute endpoint.
10 11 12 |
# File 'lib/isms/configuration.rb', line 10 def endpoint @endpoint end |
#password ⇒ Object
Returns the value of attribute password.
10 11 12 |
# File 'lib/isms/configuration.rb', line 10 def password @password end |
#protocol ⇒ Object
Returns the value of attribute protocol.
10 11 12 |
# File 'lib/isms/configuration.rb', line 10 def protocol @protocol end |
#username ⇒ Object
Returns the value of attribute username.
10 11 12 |
# File 'lib/isms/configuration.rb', line 10 def username @username end |
Class Method Details
.extended(mod) ⇒ Object
When extended, call reset to set variable values to defaults
13 14 15 |
# File 'lib/isms/configuration.rb', line 13 def self.extended(mod) mod.reset end |
Instance Method Details
#configure {|_self| ... } ⇒ Object
28 29 30 |
# File 'lib/isms/configuration.rb', line 28 def configure yield self end |
#endpoint_url_with_protocol ⇒ Object
24 25 26 |
# File 'lib/isms/configuration.rb', line 24 def endpoint_url_with_protocol "#{protocol}://#{endpoint}" end |
#reset ⇒ Object
17 18 19 20 21 22 |
# File 'lib/isms/configuration.rb', line 17 def reset self.username = DEFAULT_USERNAME self.password = DEFAULT_PASSWORD self.protocol = DEFAULT_PROTOCOL self.endpoint = DEFAULT_ENDPOINT end |