Class: MessengerPlatform::Entities::Welcome
- Inherits:
-
Object
- Object
- MessengerPlatform::Entities::Welcome
- Defined in:
- lib/messenger_platform/entities/welcome.rb
Instance Attribute Summary collapse
-
#page_id ⇒ Object
Returns the value of attribute page_id.
Instance Method Summary collapse
- #call(text) ⇒ Object
-
#initialize(page_id) ⇒ Welcome
constructor
A new instance of Welcome.
Constructor Details
#initialize(page_id) ⇒ Welcome
Returns a new instance of Welcome.
6 7 8 |
# File 'lib/messenger_platform/entities/welcome.rb', line 6 def initialize(page_id) @page_id = page_id end |
Instance Attribute Details
#page_id ⇒ Object
Returns the value of attribute page_id.
4 5 6 |
# File 'lib/messenger_platform/entities/welcome.rb', line 4 def page_id @page_id end |
Instance Method Details
#call(text) ⇒ Object
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/messenger_platform/entities/welcome.rb', line 10 def call(text) params = { access_token: Config.token, setting_type: 'call_to_actions', thread_state: 'new_thread', call_to_actions: [{ message: { text: text } }] } Typhoeus.post("#{Config.end_point}/#{page_id || Config.page_id}/thread_settings", body: params) end |