Sha256: 42fb593686d4ab934391818f0000742a09d3b8f2a75a85682b3d6a389f0fdc67

Contents?: true

Size: 369 Bytes

Versions: 14

Compression:

Stored size: 369 Bytes

Contents

module MessengerClient
  class QuickReplies
    def initialize(text, quick_replies)
      @text          = text
      @quick_replies = parse_qrs(quick_replies)
    end

    def to_json
      {
        text: @text,
        quick_replies: @quick_replies
      }
    end

    private

    def parse_qrs(quick_replies)
      quick_replies.map(&:to_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_replies.rb
messenger_client-0.2.2 lib/messenger_client/quick_replies.rb
messenger_client-0.2.1 lib/messenger_client/quick_replies.rb
messenger_client-0.2.0 lib/messenger_client/quick_replies.rb
messenger_client-0.1.9 lib/messenger_client/quick_replies.rb
messenger_client-0.1.8 lib/messenger_client/quick_replies.rb
messenger_client-0.1.7 lib/messenger_client/quick_replies.rb
messenger_client-0.1.6 lib/messenger_client/quick_replies.rb
messenger_client-0.1.5 lib/messenger_client/quick_replies.rb
messenger_client-0.1.4 lib/messenger_client/quick_replies.rb
messenger_client-0.1.3 lib/messenger_client/quick_replies.rb
messenger_client-0.1.2 lib/messenger_client/quick_replies.rb
messenger_client-0.1.1 lib/messenger_client/quick_replies.rb
messenger_client-0.1.0 lib/messenger_client/quick_replies.rb