Class: Packagecloud::Credentials

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#tokenObject (readonly)

Returns the value of attribute token.



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

def token
  @token
end

#usernameObject (readonly)

Returns the value of attribute username.



3
4
5
# File 'lib/packagecloud/credentials.rb', line 3

def username
  @username
end