class Line::Message::Builder::Container

The Container class is the top-level entry point for constructing a batch of LINE messages using the builder DSL. It acts as a holder for one or more individual message objects (such as Text or Flex messages).

When you use Line::Message::Builder.with {}, you are operating within the context of a Container instance. This container allows you to define multiple messages that can be sent together in a single API call to LINE, although the LINE API typically expects an array of message objects, which this container helps to build.

Each message added to the container can also have its own quick reply.

Example

message_payload = Line::Message::Builder.with do
  text "Hello, this is the first message!"
  flex alt_text: "This is a Flex Message" do
    bubble do
      body do
        body.text "This is a Flex Message body."
      end
    end
  end
end.build # => Returns an array of message hashes

See also: