Class: Cameraplus::User

Inherits:
Object
  • Object
show all
Defined in:
lib/cameraplus/user.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ User

Returns a new instance of User.



10
11
12
13
# File 'lib/cameraplus/user.rb', line 10

def initialize(data)
  @data = data
  parse
end

Instance Attribute Details

#avatarObject (readonly)

Returns the value of attribute avatar.



4
5
6
# File 'lib/cameraplus/user.rb', line 4

def avatar
  @avatar
end

#idObject (readonly)

Returns the value of attribute id.



4
5
6
# File 'lib/cameraplus/user.rb', line 4

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/cameraplus/user.rb', line 4

def name
  @name
end

#page_countObject (readonly)

Returns the value of attribute page_count.



4
5
6
# File 'lib/cameraplus/user.rb', line 4

def page_count
  @page_count
end

#pagesObject (readonly)

Returns the value of attribute pages.



4
5
6
# File 'lib/cameraplus/user.rb', line 4

def pages
  @pages
end

#photo_countObject (readonly)

Returns the value of attribute photo_count.



4
5
6
# File 'lib/cameraplus/user.rb', line 4

def photo_count
  @photo_count
end

#usernameObject (readonly)

Returns the value of attribute username.



4
5
6
# File 'lib/cameraplus/user.rb', line 4

def username
  @username
end

Class Method Details

.find(identifier, options = {}) ⇒ Object



6
7
8
# File 'lib/cameraplus/user.rb', line 6

def self.find(identifier, options = {})
  new Cameraplus::API::User.find(identifier, options)
end

Instance Method Details

#more_resultsObject



15
16
17
# File 'lib/cameraplus/user.rb', line 15

def more_results
  @more_results ||= User.find(username, continue: next_page_id) if has_more_pages?
end