Class: Codebits::Client

Inherits:
Object
  • Object
show all
Includes:
Connection, Project, Request, Session, Talk, User
Defined in:
lib/codebits.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Request

#get, #put

Methods included from Project

#project, #projects, #vote, #votes

Methods included from Talk

#submitions, #vote_down, #vote_up

Methods included from Session

#calendar, #session

Methods included from User

#accepted, #add_friend, #friends, #reject_friend, #sessions, #user

Constructor Details

#initialize(user, password) ⇒ Client

Returns a new instance of Client.



15
16
17
18
# File 'lib/codebits.rb', line 15

def initialize(user, password)
  @username = user
  @password = password
end

Instance Attribute Details

#authObject

Returns the value of attribute auth.



12
13
14
# File 'lib/codebits.rb', line 12

def auth
  @auth
end

#connObject

Returns the value of attribute conn.



12
13
14
# File 'lib/codebits.rb', line 12

def conn
  @conn
end

#passwordObject

Returns the value of attribute password.



12
13
14
# File 'lib/codebits.rb', line 12

def password
  @password
end

#usernameObject

Returns the value of attribute username.



12
13
14
# File 'lib/codebits.rb', line 12

def username
  @username
end

Instance Method Details

#authenticated?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/codebits.rb', line 20

def authenticated?
  !auth.nil?
end

#connected?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/codebits.rb', line 24

def connected?
  !conn.nil?
end