Sha256: b3b8e91642e050f272dd98a140029f3f979bfd601229bc9d727fbdbfde74a7b8

Contents?: true

Size: 436 Bytes

Versions: 14

Compression:

Stored size: 436 Bytes

Contents

module MessengerClient
  class QuickReply
    def initialize(text, payload=nil, image_url=nil)
      @text      = text
      @payload   = payload
      @image_url = image_url
    end

    def to_json
      json = {
        content_type: "text",
        title:        @text
      }
      json.merge!(payload: @payload)     unless @payload.nil?
      json.merge!(image_url: @image_url) unless @image_url.nil?
      json
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
messenger_client-0.2.3 lib/messenger_client/quick_reply.rb
messenger_client-0.2.2 lib/messenger_client/quick_reply.rb
messenger_client-0.2.1 lib/messenger_client/quick_reply.rb
messenger_client-0.2.0 lib/messenger_client/quick_reply.rb
messenger_client-0.1.9 lib/messenger_client/quick_reply.rb
messenger_client-0.1.8 lib/messenger_client/quick_reply.rb
messenger_client-0.1.7 lib/messenger_client/quick_reply.rb
messenger_client-0.1.6 lib/messenger_client/quick_reply.rb
messenger_client-0.1.5 lib/messenger_client/quick_reply.rb
messenger_client-0.1.4 lib/messenger_client/quick_reply.rb
messenger_client-0.1.3 lib/messenger_client/quick_reply.rb
messenger_client-0.1.2 lib/messenger_client/quick_reply.rb
messenger_client-0.1.1 lib/messenger_client/quick_reply.rb
messenger_client-0.1.0 lib/messenger_client/quick_reply.rb