Class: InstaScraper::JSON::MediaCommentStream
- Inherits:
-
InstaScraper::JSON
- Object
- InstaScraper::JSON
- InstaScraper::JSON::MediaCommentStream
- Defined in:
- lib/insta_scraper/json/media_comment_stream.rb
Instance Attribute Summary collapse
-
#comments ⇒ Object
readonly
Returns the value of attribute comments.
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#last_comment_id ⇒ Object
readonly
Returns the value of attribute last_comment_id.
-
#max_comments ⇒ Object
readonly
Returns the value of attribute max_comments.
-
#per_page ⇒ Object
readonly
Returns the value of attribute per_page.
-
#responses ⇒ Object
readonly
Returns the value of attribute responses.
-
#shortcode ⇒ Object
readonly
Returns the value of attribute shortcode.
Attributes inherited from InstaScraper::JSON
Instance Method Summary collapse
- #data ⇒ Object
-
#initialize(shortcode, options = {}) ⇒ MediaCommentStream
constructor
, last_comment_id = nil, max_comments = nil, per_page = 20).
Methods inherited from InstaScraper::JSON
Constructor Details
#initialize(shortcode, options = {}) ⇒ MediaCommentStream
, last_comment_id = nil, max_comments = nil, per_page = 20)
12 13 14 15 16 17 18 19 |
# File 'lib/insta_scraper/json/media_comment_stream.rb', line 12 def initialize(shortcode, = {})#, last_comment_id = nil, max_comments = nil, per_page = 20) @shortcode = shortcode @last_comment_id = [:last_comment_id] || nil @per_page = [:per_page] || 20 @max_comments = [:max_comments] || nil @responses = {} @comments = {} end |
Instance Attribute Details
#comments ⇒ Object (readonly)
Returns the value of attribute comments.
4 5 6 |
# File 'lib/insta_scraper/json/media_comment_stream.rb', line 4 def comments @comments end |
#error ⇒ Object (readonly)
Returns the value of attribute error.
4 5 6 |
# File 'lib/insta_scraper/json/media_comment_stream.rb', line 4 def error @error end |
#last_comment_id ⇒ Object (readonly)
Returns the value of attribute last_comment_id.
4 5 6 |
# File 'lib/insta_scraper/json/media_comment_stream.rb', line 4 def last_comment_id @last_comment_id end |
#max_comments ⇒ Object (readonly)
Returns the value of attribute max_comments.
4 5 6 |
# File 'lib/insta_scraper/json/media_comment_stream.rb', line 4 def max_comments @max_comments end |
#per_page ⇒ Object (readonly)
Returns the value of attribute per_page.
4 5 6 |
# File 'lib/insta_scraper/json/media_comment_stream.rb', line 4 def per_page @per_page end |
#responses ⇒ Object (readonly)
Returns the value of attribute responses.
4 5 6 |
# File 'lib/insta_scraper/json/media_comment_stream.rb', line 4 def responses @responses end |
#shortcode ⇒ Object (readonly)
Returns the value of attribute shortcode.
4 5 6 |
# File 'lib/insta_scraper/json/media_comment_stream.rb', line 4 def shortcode @shortcode end |
Instance Method Details
#data ⇒ Object
21 22 23 24 25 |
# File 'lib/insta_scraper/json/media_comment_stream.rb', line 21 def data Hashie::Mash.new({ comments: _data }) .extend(Hashie::Extensions::DeepFetch) .extend(Hashie::Extensions::DeepFind) end |