Class: InstaScraper::JSON
- Inherits:
-
Object
- Object
- InstaScraper::JSON
show all
- Defined in:
- lib/insta_scraper/json.rb
Defined Under Namespace
Classes: Account, AccountMedia, Media, MediaComment, MediaCommentStream
Instance Attribute Summary collapse
Instance Method Summary
collapse
Instance Attribute Details
#response ⇒ Object
16
17
18
|
# File 'lib/insta_scraper/json.rb', line 16
def response
@response ||= Faraday.get(url)
end
|
Instance Method Details
#data ⇒ Object
7
8
9
10
11
12
|
# File 'lib/insta_scraper/json.rb', line 7
def data
@data ||=
Hashie::Mash.new(::JSON.parse(raw_json))
.extend(Hashie::Extensions::DeepFetch)
.extend(Hashie::Extensions::DeepFind)
end
|
#raw_json ⇒ Object
3
4
5
|
# File 'lib/insta_scraper/json.rb', line 3
def raw_json
@raw_json ||= response.body
end
|