Class: Kickscraper::User

Inherits:
Api
  • Object
show all
Defined in:
lib/kickscraper/client/user.rb

Instance Attribute Summary collapse

Attributes inherited from Api

#raw

Instance Method Summary collapse

Methods inherited from Api

coerce, do_coercion, #initialize, #method_missing, #uid

Constructor Details

This class inherits a constructor from Kickscraper::Api

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Kickscraper::Api

Instance Attribute Details

#backed_projectsObject

Returns the value of attribute backed_projects.



3
4
5
# File 'lib/kickscraper/client/user.rb', line 3

def backed_projects
  @backed_projects
end

#starred_projectsObject

Returns the value of attribute starred_projects.



3
4
5
# File 'lib/kickscraper/client/user.rb', line 3

def starred_projects
  @starred_projects
end

Instance Method Details

#biographyObject



14
15
16
17
# File 'lib/kickscraper/client/user.rb', line 14

def biography
    reload! unless @raw['biography']
    @raw['biography']
end

#created_projectsObject



29
30
31
32
# File 'lib/kickscraper/client/user.rb', line 29

def created_projects
    return [] unless self.urls.api.created_projects
    @created_projects ||= Kickscraper.client.process_api_url("Projects", self.urls.api.created_projects)
end

#reload!Object



9
10
11
12
# File 'lib/kickscraper/client/user.rb', line 9

def reload!
    @raw = Kickscraper.client.process_api_url("User", self.urls.api.user, false)
    Kickscraper::User::do_coercion(self)
end

#to_sObject



5
6
7
# File 'lib/kickscraper/client/user.rb', line 5

def to_s
	name
end