Class: InstaScraper::HTML::Account

Inherits:
InstaScraper::HTML show all
Defined in:
lib/insta_scraper/html/account.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from InstaScraper::HTML

#data, #html

Constructor Details

#initialize(username = nil, html = nil, params = {}) ⇒ Account

Returns a new instance of Account.

Raises:

  • (ArgumentError)


6
7
8
9
10
11
12
# File 'lib/insta_scraper/html/account.rb', line 6

def initialize(username = nil, html = nil, params = {})
  raise ArgumentError, 'Provide a username or html string' if !username && !html

  @username = username
  @html = html
  @params = params
end

Instance Attribute Details

#paramsObject (readonly)

Returns the value of attribute params.



3
4
5
# File 'lib/insta_scraper/html/account.rb', line 3

def params
  @params
end

#usernameObject (readonly)

Returns the value of attribute username.



3
4
5
# File 'lib/insta_scraper/html/account.rb', line 3

def username
  @username
end

Instance Method Details

#urlObject



14
15
16
# File 'lib/insta_scraper/html/account.rb', line 14

def url
  "https://www.instagram.com/#{username}/#{serialize_params}"
end