Class: Morris::User

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end

#number_of_followersObject (readonly)

Returns the value of attribute number_of_followers.



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

def number_of_followers
  @number_of_followers
end

#number_of_followingObject (readonly)

Returns the value of attribute number_of_following.



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

def number_of_following
  @number_of_following
end

#number_of_postsObject (readonly)

Returns the value of attribute number_of_posts.



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

def number_of_posts
  @number_of_posts
end

#profileObject (readonly)

Returns the value of attribute profile.



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

def profile
  @profile
end

#profile_imageObject (readonly)

Returns the value of attribute profile_image.



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

def profile_image
  @profile_image
end

#profile_image_urlObject (readonly)

Returns the value of attribute profile_image_url.



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

def profile_image_url
  @profile_image_url
end

Returns the value of attribute profile_link.



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

def profile_link
  @profile_link
end

#usernameObject (readonly)

Returns the value of attribute username.



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

def username
  @username
end

#verifiedObject (readonly)

Returns the value of attribute verified.



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

def verified
  @verified
end

Class Method Details

.lookup(usernames = []) ⇒ Object



5
6
7
8
9
10
11
12
13
# File 'lib/morris/user.rb', line 5

def self.lookup(usernames = [])
  # If a single id is passed in we make it the appropriate array
  usernames = [usernames] unless usernames.kind_of?(Array)

  # Check that the usernames are at least real usernames
  # usernames.each { |id| raise Birdsong::Error if !/\A\d+\z/.match(id) }

  self.scrape(usernames)
end