Class: FBScrape::Conversation

Inherits:
Object
  • Object
show all
Defined in:
lib/fb_scrape/conversation.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id, page_id, token, load_on_init = true) ⇒ Conversation

Returns a new instance of Conversation.



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/fb_scrape/conversation.rb', line 5

def initialize id, page_id, token, load_on_init=true
  @id = id
  @page_id = page_id
  @token = token
  @page_info = nil
  @messages = []

  if load_on_init
    load_messages
  end
end

Instance Attribute Details

#idObject

Returns the value of attribute id.



3
4
5
# File 'lib/fb_scrape/conversation.rb', line 3

def id
  @id
end

#messagesObject

Returns the value of attribute messages.



3
4
5
# File 'lib/fb_scrape/conversation.rb', line 3

def messages
  @messages
end

#page_idObject

Returns the value of attribute page_id.



3
4
5
# File 'lib/fb_scrape/conversation.rb', line 3

def page_id
  @page_id
end

#updated_atObject

Returns the value of attribute updated_at.



3
4
5
# File 'lib/fb_scrape/conversation.rb', line 3

def updated_at
  @updated_at
end

Instance Method Details

#has_more_messages?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/fb_scrape/conversation.rb', line 21

def has_more_messages?
  @page_info && next_cursor
end

#load_messagesObject



17
18
19
# File 'lib/fb_scrape/conversation.rb', line 17

def load_messages
  load_initial_messages
end