Class: InstaScraper::JSON::AccountMedia
- Inherits:
-
InstaScraper::JSON
- Object
- InstaScraper::JSON
- InstaScraper::JSON::AccountMedia
- Defined in:
- lib/insta_scraper/json/account_media.rb
Instance Attribute Summary collapse
-
#end_cursor ⇒ Object
readonly
Returns the value of attribute end_cursor.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#per_page ⇒ Object
readonly
Returns the value of attribute per_page.
Attributes inherited from InstaScraper::JSON
Instance Method Summary collapse
-
#initialize(id:, per_page: 12, end_cursor: nil) ⇒ AccountMedia
constructor
A new instance of AccountMedia.
- #params ⇒ Object
- #url ⇒ Object
- #variables ⇒ Object
Methods inherited from InstaScraper::JSON
Constructor Details
#initialize(id:, per_page: 12, end_cursor: nil) ⇒ AccountMedia
Returns a new instance of AccountMedia.
5 6 7 8 9 |
# File 'lib/insta_scraper/json/account_media.rb', line 5 def initialize(id:, per_page: 12, end_cursor: nil) @id = id @per_page = per_page @end_cursor = end_cursor end |
Instance Attribute Details
#end_cursor ⇒ Object (readonly)
Returns the value of attribute end_cursor.
3 4 5 |
# File 'lib/insta_scraper/json/account_media.rb', line 3 def end_cursor @end_cursor end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
3 4 5 |
# File 'lib/insta_scraper/json/account_media.rb', line 3 def id @id end |
#per_page ⇒ Object (readonly)
Returns the value of attribute per_page.
3 4 5 |
# File 'lib/insta_scraper/json/account_media.rb', line 3 def per_page @per_page end |
Instance Method Details
#params ⇒ Object
19 20 21 22 23 24 |
# File 'lib/insta_scraper/json/account_media.rb', line 19 def params { query_id: 17888483320059182, variables: variables, } end |
#url ⇒ Object
26 27 28 |
# File 'lib/insta_scraper/json/account_media.rb', line 26 def url "https://www.instagram.com/graphql/query/#{serialize_params}" end |
#variables ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/insta_scraper/json/account_media.rb', line 11 def variables if end_cursor "{\"id\":\"#{id}\",\"first\":#{per_page},\"after\":\"#{end_cursor}\"}" else "{\"id\":\"#{id}\",\"first\":#{per_page}}" end end |