Class: DbUrlHelper::Credentials::Generic
- Inherits:
-
Object
- Object
- DbUrlHelper::Credentials::Generic
show all
- Defined in:
- lib/db_url_helper/credentials/generic.rb
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
#initialize(service, filters: []) ⇒ Generic
Returns a new instance of Generic.
13
14
15
16
|
# File 'lib/db_url_helper/credentials/generic.rb', line 13
def initialize service, filters:[]
@service = service
@filters = filters
end
|
Instance Attribute Details
#service ⇒ Object
Returns the value of attribute service.
12
13
14
|
# File 'lib/db_url_helper/credentials/generic.rb', line 12
def service
@service
end
|
Class Method Details
.weight ⇒ Object
8
9
10
|
# File 'lib/db_url_helper/credentials/generic.rb', line 8
def self.weight
self::WEIGHT
end
|
Instance Method Details
#credential ⇒ Object
33
34
35
|
# File 'lib/db_url_helper/credentials/generic.rb', line 33
def credential
OpenStruct.new(user:nil,password:nil)
end
|
#filters ⇒ Object
20
21
22
|
# File 'lib/db_url_helper/credentials/generic.rb', line 20
def filters
@filters ||= []
end
|
#filters=(filters) ⇒ Object
17
18
19
|
# File 'lib/db_url_helper/credentials/generic.rb', line 17
def filters= filters
@filters = filters
end
|
#load ⇒ Object
36
37
38
|
# File 'lib/db_url_helper/credentials/generic.rb', line 36
def load
Credential.new user,password,weight,self
end
|
#password ⇒ Object
30
31
32
|
# File 'lib/db_url_helper/credentials/generic.rb', line 30
def password
credential.password
end
|
#user ⇒ Object
27
28
29
|
# File 'lib/db_url_helper/credentials/generic.rb', line 27
def user
credential.user
end
|
#weight ⇒ Object
23
24
25
26
|
# File 'lib/db_url_helper/credentials/generic.rb', line 23
def weight
return 0 if user.nil? and password.nil?
self.class::WEIGHT
end
|