Class: Travis::Client::User

Inherits:
Entity
  • Object
show all
Defined in:
lib/travis/client/user.rb

Constant Summary

Constants inherited from Entity

Entity::MAP

Instance Attribute Summary collapse

Attributes inherited from Entity

#attributes, #curry, #id, #session

Instance Method Summary collapse

Methods inherited from Entity

#[], #[]=, aka, #attribute_names, attributes, #cancelable?, cast_id, #complete?, has, #include?, #initialize, #inspect, inspect_info, #load, many, #missing?, one, relations, #relations, #reload, #restartable?, subclass_for, subclasses, time, #update_attributes

Constructor Details

This class inherits a constructor from Travis::Client::Entity

Instance Attribute Details

#correct_scopesObject (readonly) Also known as: correct_scopes?

Returns the value of attribute correct_scopes.



1
2
3
# File 'lib/travis/client/user.rb', line 1

def correct_scopes
  @correct_scopes
end

#emailObject (readonly)

Returns the value of attribute email.



1
2
3
# File 'lib/travis/client/user.rb', line 1

def email
  @email
end

#gravatar_idObject (readonly)

Returns the value of attribute gravatar_id.



1
2
3
# File 'lib/travis/client/user.rb', line 1

def gravatar_id
  @gravatar_id
end

#is_syncingObject (readonly) Also known as: syncing?

Returns the value of attribute is_syncing.



1
2
3
# File 'lib/travis/client/user.rb', line 1

def is_syncing
  @is_syncing
end

#localeObject (readonly)

Returns the value of attribute locale.



1
2
3
# File 'lib/travis/client/user.rb', line 1

def locale
  @locale
end

#loginObject (readonly)

Returns the value of attribute login.



1
2
3
# File 'lib/travis/client/user.rb', line 1

def 
  @login
end

#nameObject (readonly)

Returns the value of attribute name.



1
2
3
# File 'lib/travis/client/user.rb', line 1

def name
  @name
end

#synced_atObject

Returns the value of attribute synced_at.



1
2
3
# File 'lib/travis/client/user.rb', line 1

def synced_at
  @synced_at
end

Instance Method Details

#channelsObject



22
23
24
25
# File 'lib/travis/client/user.rb', line 22

def channels
  load_attribute(:is_syncing) # dummy to trigger load, as channels might not be included
  attributes['channels'] ||= ['common']
end

#repositoriesObject



27
28
29
# File 'lib/travis/client/user.rb', line 27

def repositories
  attributes['repositories'] ||= session.get('/users/permissions')['permissions']
end

#syncObject



17
18
19
20
# File 'lib/travis/client/user.rb', line 17

def sync
  session.post_raw('/users/sync')
  reload
end