Class: DbUrlHelper::Credentials::Credential

Inherits:
Object
  • Object
show all
Defined in:
lib/db_url_helper/credentials/credential.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(user = "", password = "", weight = -1,, provider = nil) ⇒ Credential

Returns a new instance of Credential.



5
6
7
8
9
10
# File 'lib/db_url_helper/credentials/credential.rb', line 5

def initialize user="",password="",weight=-1,provider=nil
  @user     = user
  @password = password
  @weight   = weight
  @provider = provider
end

Instance Attribute Details

#passwordObject

Returns the value of attribute password.



4
5
6
# File 'lib/db_url_helper/credentials/credential.rb', line 4

def password
  @password
end

#providerObject

Returns the value of attribute provider.



4
5
6
# File 'lib/db_url_helper/credentials/credential.rb', line 4

def provider
  @provider
end

#userObject

Returns the value of attribute user.



4
5
6
# File 'lib/db_url_helper/credentials/credential.rb', line 4

def user
  @user
end

#weightObject

Returns the value of attribute weight.



4
5
6
# File 'lib/db_url_helper/credentials/credential.rb', line 4

def weight
  @weight
end

Instance Method Details

#<=>(right) ⇒ Object



11
12
13
# File 'lib/db_url_helper/credentials/credential.rb', line 11

def <=> right
  weight <=> right.weight
end