Class: InstaScraper::JSON::Account
- Inherits:
-
InstaScraper::JSON
- Object
- InstaScraper::JSON
- InstaScraper::JSON::Account
- Defined in:
- lib/insta_scraper/json/account.rb
Instance Attribute Summary collapse
-
#username ⇒ Object
readonly
Returns the value of attribute username.
Instance Method Summary collapse
- #data ⇒ Object
-
#initialize(username) ⇒ Account
constructor
A new instance of Account.
- #url ⇒ Object
Methods inherited from InstaScraper::JSON
Constructor Details
#initialize(username) ⇒ Account
Returns a new instance of Account.
5 6 7 |
# File 'lib/insta_scraper/json/account.rb', line 5 def initialize(username) @username = username end |
Instance Attribute Details
#username ⇒ Object (readonly)
Returns the value of attribute username.
3 4 5 |
# File 'lib/insta_scraper/json/account.rb', line 3 def username @username end |
Instance Method Details
#data ⇒ Object
13 14 15 16 17 18 |
# File 'lib/insta_scraper/json/account.rb', line 13 def data @data ||= Hashie::Mash.new(::JSON.parse(raw_json)) .extend(Hashie::Extensions::DeepFetch) .extend(Hashie::Extensions::DeepFind) end |
#url ⇒ Object
9 10 11 |
# File 'lib/insta_scraper/json/account.rb', line 9 def url "https://www.instagram.com/#{username}/?__a=1" end |