Class: Messenger::Elements::QuickReply

Inherits:
Object
  • Object
show all
Includes:
Components::Element
Defined in:
lib/messenger/components/elements/quick_reply.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Components::Element

#build, #build_elements

Constructor Details

#initialize(content_type:, title: nil, payload: nil, image_url: nil) ⇒ QuickReply

Returns a new instance of QuickReply.



10
11
12
13
14
15
# File 'lib/messenger/components/elements/quick_reply.rb', line 10

def initialize(content_type:, title: nil, payload: nil, image_url: nil)
  @content_type    = content_type
  @title    = title if text?(content_type)
  @payload = payload if text?(content_type)
  @image_url = image_url
end

Instance Attribute Details

#content_typeObject

Returns the value of attribute content_type.



8
9
10
# File 'lib/messenger/components/elements/quick_reply.rb', line 8

def content_type
  @content_type
end

#image_urlObject

Returns the value of attribute image_url.



8
9
10
# File 'lib/messenger/components/elements/quick_reply.rb', line 8

def image_url
  @image_url
end

#payloadObject

Returns the value of attribute payload.



8
9
10
# File 'lib/messenger/components/elements/quick_reply.rb', line 8

def payload
  @payload
end

#titleObject

Returns the value of attribute title.



8
9
10
# File 'lib/messenger/components/elements/quick_reply.rb', line 8

def title
  @title
end