Class: MessageQuickly::Messaging::PostbackButton

Inherits:
Button
  • Object
show all
Defined in:
lib/message_quickly/messaging/postback_button.rb

Instance Attribute Summary collapse

Attributes inherited from Button

#title, #type

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ PostbackButton

Returns a new instance of PostbackButton.



7
8
9
10
# File 'lib/message_quickly/messaging/postback_button.rb', line 7

def initialize(params = {})
  params['type'] ||= 'postback'
  super(params)
end

Instance Attribute Details

#payloadObject

Returns the value of attribute payload.



5
6
7
# File 'lib/message_quickly/messaging/postback_button.rb', line 5

def payload
  @payload
end

Instance Method Details

#to_hashObject



12
13
14
# File 'lib/message_quickly/messaging/postback_button.rb', line 12

def to_hash
  { type: type, title: title, payload: payload }
end