Module: TFS::Configuration
Constant Summary collapse
- CONNECTION_DEFAULTS =
{ rest_options: { headers: { user_agent: "TFS Ruby Gem" }, request: { open_timeout: 5, timeout: 10, }, }, verify_ssl: false }
Instance Attribute Summary collapse
-
#connection_options ⇒ Object
Returns the value of attribute connection_options.
-
#endpoint ⇒ Object
Returns the value of attribute endpoint.
-
#namespace ⇒ Object
Returns the value of attribute namespace.
-
#password ⇒ Object
writeonly
Sets the attribute password.
-
#provider ⇒ Object
Returns the value of attribute provider.
-
#username ⇒ Object
writeonly
Sets the attribute username.
Class Method Summary collapse
- .connection_options ⇒ Object
- .endpoint ⇒ Object
- .keys ⇒ Object
-
.namespace ⇒ Object
No default namespace.
- .options ⇒ Object
- .password ⇒ Object
- .provider ⇒ Object
- .username ⇒ Object
Instance Method Summary collapse
- #configure {|_self| ... } ⇒ Object
- #reset! ⇒ Object (also: #setup)
Instance Attribute Details
#connection_options ⇒ Object
Returns the value of attribute connection_options.
8 9 10 |
# File 'lib/tfs/configuration.rb', line 8 def @connection_options end |
#endpoint ⇒ Object
Returns the value of attribute endpoint.
8 9 10 |
# File 'lib/tfs/configuration.rb', line 8 def endpoint @endpoint end |
#namespace ⇒ Object
Returns the value of attribute namespace.
8 9 10 |
# File 'lib/tfs/configuration.rb', line 8 def namespace @namespace end |
#password=(value) ⇒ Object (writeonly)
Sets the attribute password
7 8 9 |
# File 'lib/tfs/configuration.rb', line 7 def password=(value) @password = value end |
#provider ⇒ Object
Returns the value of attribute provider.
8 9 10 |
# File 'lib/tfs/configuration.rb', line 8 def provider @provider end |
#username=(value) ⇒ Object (writeonly)
Sets the attribute username
7 8 9 |
# File 'lib/tfs/configuration.rb', line 7 def username=(value) @username = value end |
Class Method Details
.connection_options ⇒ Object
37 38 39 |
# File 'lib/tfs/configuration.rb', line 37 def CONNECTION_DEFAULTS end |
.endpoint ⇒ Object
49 50 51 |
# File 'lib/tfs/configuration.rb', line 49 def endpoint ENV['TFS_ENDPOINT'] end |
.keys ⇒ Object
26 27 28 29 30 31 32 33 34 35 |
# File 'lib/tfs/configuration.rb', line 26 def keys @keys ||= [ :username, :password, :endpoint, :connection_options, :provider, :namespace ] end |
.namespace ⇒ Object
No default namespace
62 |
# File 'lib/tfs/configuration.rb', line 62 def namespace ; end |
.options ⇒ Object
57 58 59 |
# File 'lib/tfs/configuration.rb', line 57 def Hash[Configuration.keys.map{|key| [key, send(key)]}] end |
.password ⇒ Object
45 46 47 |
# File 'lib/tfs/configuration.rb', line 45 def password ENV['TFS_PASSWORD'] end |
.provider ⇒ Object
53 54 55 |
# File 'lib/tfs/configuration.rb', line 53 def provider OData::Service end |
.username ⇒ Object
41 42 43 |
# File 'lib/tfs/configuration.rb', line 41 def username ENV['TFS_USERNAME'] end |
Instance Method Details
#configure {|_self| ... } ⇒ Object
65 66 67 68 |
# File 'lib/tfs/configuration.rb', line 65 def configure yield self self end |
#reset! ⇒ Object Also known as: setup
70 71 72 73 74 75 |
# File 'lib/tfs/configuration.rb', line 70 def reset! TFS::Configuration.keys.each do |key| instance_variable_set(:"@#{key}", Configuration.[key]) end self end |