Class: Packagecloud::Credentials
- Inherits:
-
Object
- Object
- Packagecloud::Credentials
- Defined in:
- lib/packagecloud/credentials.rb
Instance Attribute Summary collapse
-
#token ⇒ Object
readonly
Returns the value of attribute token.
-
#username ⇒ Object
readonly
Returns the value of attribute username.
Instance Method Summary collapse
-
#initialize(username, token) ⇒ Credentials
constructor
A new instance of Credentials.
Constructor Details
#initialize(username, token) ⇒ Credentials
Returns a new instance of Credentials.
6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/packagecloud/credentials.rb', line 6 def initialize(username, token) @username = username @token = token if @username.include?("@") raise InvalidUsernameException.new("Sorry, looks like you may have " \ "tried to use an email address " \ "instead of your packagecloud.io " \ "username. Please use your " \ "username instead!") end end |
Instance Attribute Details
#token ⇒ Object (readonly)
Returns the value of attribute token.
4 5 6 |
# File 'lib/packagecloud/credentials.rb', line 4 def token @token end |
#username ⇒ Object (readonly)
Returns the value of attribute username.
3 4 5 |
# File 'lib/packagecloud/credentials.rb', line 3 def username @username end |