Class: IGScrape::Client
- Inherits:
-
Object
- Object
- IGScrape::Client
- Defined in:
- lib/ig_scrape/client.rb
Instance Attribute Summary collapse
-
#follower_count ⇒ Object
Returns the value of attribute follower_count.
-
#follows_count ⇒ Object
Returns the value of attribute follows_count.
-
#full_name ⇒ Object
Returns the value of attribute full_name.
-
#id ⇒ Object
Returns the value of attribute id.
-
#post_count ⇒ Object
Returns the value of attribute post_count.
-
#posts ⇒ Object
Returns the value of attribute posts.
-
#profile_pic_url ⇒ Object
Returns the value of attribute profile_pic_url.
-
#username ⇒ Object
Returns the value of attribute username.
Instance Method Summary collapse
- #has_more_posts? ⇒ Boolean
-
#initialize(username) ⇒ Client
constructor
A new instance of Client.
- #load ⇒ Object
- #loaded_post_count ⇒ Object
Constructor Details
#initialize(username) ⇒ Client
Returns a new instance of Client.
7 8 9 10 11 |
# File 'lib/ig_scrape/client.rb', line 7 def initialize(username) @username = username @posts = [] load_profile end |
Instance Attribute Details
#follower_count ⇒ Object
Returns the value of attribute follower_count.
5 6 7 |
# File 'lib/ig_scrape/client.rb', line 5 def follower_count @follower_count end |
#follows_count ⇒ Object
Returns the value of attribute follows_count.
5 6 7 |
# File 'lib/ig_scrape/client.rb', line 5 def follows_count @follows_count end |
#full_name ⇒ Object
Returns the value of attribute full_name.
5 6 7 |
# File 'lib/ig_scrape/client.rb', line 5 def full_name @full_name end |
#id ⇒ Object
Returns the value of attribute id.
5 6 7 |
# File 'lib/ig_scrape/client.rb', line 5 def id @id end |
#post_count ⇒ Object
Returns the value of attribute post_count.
5 6 7 |
# File 'lib/ig_scrape/client.rb', line 5 def post_count @post_count end |
#posts ⇒ Object
Returns the value of attribute posts.
5 6 7 |
# File 'lib/ig_scrape/client.rb', line 5 def posts @posts end |
#profile_pic_url ⇒ Object
Returns the value of attribute profile_pic_url.
5 6 7 |
# File 'lib/ig_scrape/client.rb', line 5 def profile_pic_url @profile_pic_url end |
#username ⇒ Object
Returns the value of attribute username.
5 6 7 |
# File 'lib/ig_scrape/client.rb', line 5 def username @username end |
Instance Method Details
#has_more_posts? ⇒ Boolean
19 20 21 |
# File 'lib/ig_scrape/client.rb', line 19 def has_more_posts? @posts.length < @post_count end |
#load ⇒ Object
13 14 15 16 17 |
# File 'lib/ig_scrape/client.rb', line 13 def load while has_more_posts? do load_more_posts end end |
#loaded_post_count ⇒ Object
23 24 25 |
# File 'lib/ig_scrape/client.rb', line 23 def loaded_post_count @posts.length end |