Class: Ronin::WebCredential
- Inherits:
-
Credential
- Object
- Credential
- Ronin::WebCredential
- Defined in:
- lib/ronin/web_credential.rb
Overview
Represents Credentials used to access websites at specified URLs.
Class Method Summary collapse
-
.with_email(email) ⇒ Array<WebCredential>
Searches all web credentials that are associated with an email address.
Instance Method Summary collapse
-
#to_s ⇒ String
Converts the web credential to a String.
Methods inherited from Credential
#clear_text, for_user, #to_ary, #user, with_password
Methods included from Model
Class Method Details
.with_email(email) ⇒ Array<WebCredential>
Searches all web credentials that are associated with an email address.
51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/ronin/web_credential.rb', line 51 def self.with_email(email) unless email.include?('@') raise("invalid email address #{email.dump}") end user, domain = email.split('@',2) return all( 'email_address.user_name.name' => user, 'email_address.host_name.address' => domain ) end |
Instance Method Details
#to_s ⇒ String
Converts the web credential to a String.
74 75 76 77 78 79 80 |
# File 'lib/ronin/web_credential.rb', line 74 def to_s if self.email_address "#{super} (#{self.email_address})" else super end end |