Class: IGScrape::Comment
- Inherits:
-
Object
- Object
- IGScrape::Comment
- Defined in:
- lib/ig_scrape/comment.rb
Instance Attribute Summary collapse
-
#author_id ⇒ Object
Returns the value of attribute author_id.
-
#author_name ⇒ Object
Returns the value of attribute author_name.
-
#author_profile_pic ⇒ Object
Returns the value of attribute author_profile_pic.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#id ⇒ Object
Returns the value of attribute id.
-
#text ⇒ Object
Returns the value of attribute text.
Instance Method Summary collapse
-
#initialize(payload) ⇒ Comment
constructor
A new instance of Comment.
- #to_json(*args) ⇒ Object
Constructor Details
#initialize(payload) ⇒ Comment
Returns a new instance of Comment.
5 6 7 |
# File 'lib/ig_scrape/comment.rb', line 5 def initialize(payload) load_from_payload(payload) end |
Instance Attribute Details
#author_id ⇒ Object
Returns the value of attribute author_id.
3 4 5 |
# File 'lib/ig_scrape/comment.rb', line 3 def @author_id end |
#author_name ⇒ Object
Returns the value of attribute author_name.
3 4 5 |
# File 'lib/ig_scrape/comment.rb', line 3 def @author_name end |
#author_profile_pic ⇒ Object
Returns the value of attribute author_profile_pic.
3 4 5 |
# File 'lib/ig_scrape/comment.rb', line 3 def @author_profile_pic end |
#created_at ⇒ Object
Returns the value of attribute created_at.
3 4 5 |
# File 'lib/ig_scrape/comment.rb', line 3 def created_at @created_at end |
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'lib/ig_scrape/comment.rb', line 3 def id @id end |
#text ⇒ Object
Returns the value of attribute text.
3 4 5 |
# File 'lib/ig_scrape/comment.rb', line 3 def text @text end |
Instance Method Details
#to_json(*args) ⇒ Object
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/ig_scrape/comment.rb', line 9 def to_json(*args) JSON.generate({ id: @id, text: @text, created_at: @created_at, author_id: @author_id, author_name: @author_name, author_profile_pic: @author_profile_pic }) end |