Class: Fb::Messenger::Template::Button

Inherits:
Object
  • Object
show all
Defined in:
lib/fb/messenger/templates/button.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ Button

Returns a new instance of Button.



7
8
9
10
11
# File 'lib/fb/messenger/templates/button.rb', line 7

def initialize(opts = {})
  @type = opts[:type]
  @title = opts[:title]
  @payload = opts[:payload]
end

Instance Attribute Details

#payloadObject

Returns the value of attribute payload.



5
6
7
# File 'lib/fb/messenger/templates/button.rb', line 5

def payload
  @payload
end

#titleObject

Returns the value of attribute title.



5
6
7
# File 'lib/fb/messenger/templates/button.rb', line 5

def title
  @title
end

#typeObject

Returns the value of attribute type.



5
6
7
# File 'lib/fb/messenger/templates/button.rb', line 5

def type
  @type
end

Instance Method Details

#templateObject



13
14
15
16
17
18
19
# File 'lib/fb/messenger/templates/button.rb', line 13

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