class Line::Message::Builder::Flex::Builder

The Builder class is the main entry point for constructing a complete LINE Flex Message. A Flex Message is a highly customizable message type that can contain one main content element, which is either a single Bubble or a Carousel of bubbles.

This builder requires alt_text (alternative text) for accessibility and for display on devices or LINE versions that cannot render Flex Messages. It can also have a quickReply attached to it.

Example: Creating a Flex Message with a single bubble

Line::Message::Builder.with do
  flex alt_text: "My Product" do
    flex_builder.bubble size: :giga do
      hero_image "https://example.com/product.jpg"
      body do
        text "Product Name", weight: :bold, size: :xl
      end
    end
    quick_reply do
      button action: :message, label: "Learn More", text: "Tell me more"
    end
  end
end

See also: