Class: Camdram::User

Inherits:
Base
  • Object
show all
Includes:
API, Refreshable
Defined in:
lib/camdram/user.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#id

Instance Method Summary collapse

Methods included from Refreshable

#refresh!

Methods inherited from Base

#initialize, #make_orphan

Constructor Details

This class inherits a constructor from Camdram::Base

Instance Attribute Details

#emailObject

Returns the value of attribute email


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

def email
  @email
end

#nameObject

Returns the value of attribute name


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

def name
  @name
end

Instance Method Details

#get_showsArray

Return an array of shows the user is authorised for

Returns:

  • (Array)

    An array of Camdram::Show objects.


35
36
37
38
# File 'lib/camdram/user.rb', line 35

def get_shows
  slug = "/auth/account/shows.json"
  get_array(slug, Show)
end

#get_societiesArray

Return an array of societies the user is authorised for

Returns:

  • (Array)

    An array of Camdram::Society objects.


43
44
45
# File 'lib/camdram/user.rb', line 43

def get_societies
  orgs_share('society')
end

#get_venuesArray

Return an array of venues the user is authorised for

Returns:

  • (Array)

    An array of Camdram::Venue objects.


50
51
52
# File 'lib/camdram/user.rb', line 50

def get_venues
  orgs_share('venue')
end

#infoHash

Return a hash of the user's attributes

Returns:

  • (Hash)

    Hash with symbolized keys.


17
18
19
20
21
22
23
# File 'lib/camdram/user.rb', line 17

def info
  {
    id: id,
    name: name,
    email: email,
  }
end

#url_slugString

Return the unique Camdram URL slug of the user

Returns:

  • (String)

    The full URL slug.


28
29
30
# File 'lib/camdram/user.rb', line 28

def url_slug
  "/auth/account.json"
end