Class: IGScrape::Comment

Inherits:
Object
  • Object
show all
Defined in:
lib/ig_scrape/comment.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_idObject

Returns the value of attribute author_id.



3
4
5
# File 'lib/ig_scrape/comment.rb', line 3

def author_id
  @author_id
end

#author_nameObject

Returns the value of attribute author_name.



3
4
5
# File 'lib/ig_scrape/comment.rb', line 3

def author_name
  @author_name
end

#author_profile_picObject

Returns the value of attribute author_profile_pic.



3
4
5
# File 'lib/ig_scrape/comment.rb', line 3

def author_profile_pic
  @author_profile_pic
end

#created_atObject

Returns the value of attribute created_at.



3
4
5
# File 'lib/ig_scrape/comment.rb', line 3

def created_at
  @created_at
end

#idObject

Returns the value of attribute id.



3
4
5
# File 'lib/ig_scrape/comment.rb', line 3

def id
  @id
end

#textObject

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