Class: Morris::User
- Inherits:
-
Object
- Object
- Morris::User
- Defined in:
- lib/morris/user.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#number_of_followers ⇒ Object
readonly
Returns the value of attribute number_of_followers.
-
#number_of_following ⇒ Object
readonly
Returns the value of attribute number_of_following.
-
#number_of_posts ⇒ Object
readonly
Returns the value of attribute number_of_posts.
-
#profile ⇒ Object
readonly
Returns the value of attribute profile.
-
#profile_image ⇒ Object
readonly
Returns the value of attribute profile_image.
-
#profile_image_url ⇒ Object
readonly
Returns the value of attribute profile_image_url.
-
#profile_link ⇒ Object
readonly
Returns the value of attribute profile_link.
-
#username ⇒ Object
readonly
Returns the value of attribute username.
-
#verified ⇒ Object
readonly
Returns the value of attribute verified.
Class Method Summary collapse
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
15 16 17 |
# File 'lib/morris/user.rb', line 15 def name @name end |
#number_of_followers ⇒ Object (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_following ⇒ Object (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_posts ⇒ Object (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 |
#profile ⇒ Object (readonly)
Returns the value of attribute profile.
15 16 17 |
# File 'lib/morris/user.rb', line 15 def profile @profile end |
#profile_image ⇒ Object (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_url ⇒ Object (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 |
#profile_link ⇒ Object (readonly)
Returns the value of attribute profile_link.
15 16 17 |
# File 'lib/morris/user.rb', line 15 def profile_link @profile_link end |
#username ⇒ Object (readonly)
Returns the value of attribute username.
15 16 17 |
# File 'lib/morris/user.rb', line 15 def username @username end |
#verified ⇒ Object (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 |