Class: Facebook::Messenger::Incoming::Optin

Inherits:
Object
  • Object
show all
Includes:
Common
Defined in:
lib/facebook/messenger/incoming/optin.rb

Overview

The Optin class represents an incoming Facebook Messenger optin, which occurs when a user engages by using the Send-to-Messenger Plugin.

Instance Attribute Summary

Attributes included from Common

#messaging

Instance Method Summary collapse

Methods included from Common

#access_token, #initialize, #mark_seen, #prior_message, #recipient, #reply, #sender, #sent_at, #typing_off, #typing_on

Instance Method Details

#refString

Function returns ‘data-ref’ attribute that was defined

with the entry point.

Returns:

  • (String)

    data-ref attribute.



19
20
21
# File 'lib/facebook/messenger/incoming/optin.rb', line 19

def ref
  @messaging['optin']['ref']
end

#user_refString

Function returns ‘user_ref’ attribute defined in checkbox plugin.

Returns:

  • (String)

    user-ref attribute.



28
29
30
# File 'lib/facebook/messenger/incoming/optin.rb', line 28

def user_ref
  @messaging['optin']['user_ref']
end