Class: AOJ::Credential

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#passwordObject

Returns the value of attribute password.



3
4
5
# File 'lib/aoj/credential.rb', line 3

def password
  @password
end

#usernameObject

Returns the value of attribute username.



3
4
5
# File 'lib/aoj/credential.rb', line 3

def username
  @username
end

Class Method Details

.getObject



9
10
11
12
13
14
# File 'lib/aoj/credential.rb', line 9

def self.get
  Credential.new.tap do |c|
    c.username = AOJ::Conf.instance['username']
    c.password = AOJ::Conf.instance['password']
  end
end

Instance Method Details

#valid?Boolean

Returns:

  • (Boolean)


5
6
7
# File 'lib/aoj/credential.rb', line 5

def valid?
  AOJ::API.loginable?(self)
end