line-message-builder 0.8.0 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/.release-please-manifest.json +1 -1
  3. data/.rubocop.yml +5 -0
  4. data/CHANGELOG.md +41 -0
  5. data/CLAUDE.md +124 -0
  6. data/CONVENTIONS.md +36 -0
  7. data/README.md +61 -43
  8. data/claudekit.json +11 -0
  9. data/docs/rubrics/rdoc.md +169 -0
  10. data/lib/line/message/builder/actions/message.rb +52 -31
  11. data/lib/line/message/builder/actions/postback.rb +63 -33
  12. data/lib/line/message/builder/actions/uri.rb +139 -0
  13. data/lib/line/message/builder/actions.rb +6 -3
  14. data/lib/line/message/builder/base.rb +92 -67
  15. data/lib/line/message/builder/container.rb +64 -69
  16. data/lib/line/message/builder/context.rb +55 -80
  17. data/lib/line/message/builder/flex/actionable.rb +53 -32
  18. data/lib/line/message/builder/flex/box.rb +366 -79
  19. data/lib/line/message/builder/flex/bubble.rb +78 -51
  20. data/lib/line/message/builder/flex/builder.rb +47 -36
  21. data/lib/line/message/builder/flex/button.rb +96 -48
  22. data/lib/line/message/builder/flex/carousel.rb +57 -29
  23. data/lib/line/message/builder/flex/icon.rb +152 -0
  24. data/lib/line/message/builder/flex/image.rb +103 -42
  25. data/lib/line/message/builder/flex/partial.rb +58 -55
  26. data/lib/line/message/builder/flex/position.rb +187 -100
  27. data/lib/line/message/builder/flex/separator.rb +84 -0
  28. data/lib/line/message/builder/flex/size.rb +67 -47
  29. data/lib/line/message/builder/flex/span.rb +184 -0
  30. data/lib/line/message/builder/flex/text.rb +210 -54
  31. data/lib/line/message/builder/flex.rb +31 -26
  32. data/lib/line/message/builder/quick_reply.rb +174 -4
  33. data/lib/line/message/builder/text.rb +70 -3
  34. data/lib/line/message/builder/version.rb +1 -1
  35. data/lib/line/message/builder.rb +16 -13
  36. data/lib/line/message/rspec/matchers/have_flex_bubble.rb +1 -1
  37. data/lib/line/message/rspec/matchers/have_flex_component.rb +26 -5
  38. data/lib/line/message/rspec/matchers/have_flex_message.rb +1 -1
  39. data/lib/line/message/rspec/matchers/have_flex_separator.rb +20 -0
  40. data/lib/line/message/rspec/matchers/have_quick_reply.rb +1 -1
  41. data/lib/line/message/rspec/matchers/have_text_message.rb +1 -1
  42. data/lib/line/message/rspec/matchers.rb +1 -0
  43. data/llm.txt +367 -45
  44. data/release-please-config.json +3 -1
  45. metadata +12 -3
@@ -8,54 +8,73 @@ module Line
8
8
  # A bubble is a self-contained unit of content, structured into optional
9
9
  # sections: header, hero (an image or box), body, and footer.
10
10
  # Bubbles are the fundamental building blocks for single Flex Messages or
11
- # for each item in a {Carousel} container.
11
+ # for each item in a Carousel container.
12
12
  #
13
- # @example Creating a simple bubble with a body
14
- # Line::Message::Builder.with do |root|
15
- # root.flex alt_text: "Simple Bubble" do |flex|
16
- # flex.bubble do |bubble|
17
- # bubble.body do |body_box|
18
- # body_box.text "Hello, this is a bubble!"
13
+ # == Example: Creating a simple bubble with a body
14
+ #
15
+ # Line::Message::Builder.with do
16
+ # flex alt_text: "Simple Bubble" do
17
+ # bubble do
18
+ # body do
19
+ # text "Hello, this is a bubble!"
19
20
  # end
20
21
  # end
21
22
  # end
22
23
  # end
23
24
  #
24
- # @see https://developers.line.biz/en/reference/messaging-api/#bubble
25
- # @see HasPartial For including reusable component groups within sections.
26
- # @see Box For the structure of header, hero (if box), body, and footer.
27
- # @see Image For using an image as a hero section.
25
+ # See also:
26
+ # - https://developers.line.biz/en/reference/messaging-api/#bubble
27
+ # - HasPartial
28
+ # - Box
29
+ # - Image
28
30
  class Bubble < Line::Message::Builder::Base
29
31
  include HasPartial # Allows including predefined partial component sets into sections.
30
32
 
33
+ # :method: size
34
+ #
35
+ # :call-seq:
36
+ # size() -> Symbol, String, or nil
37
+ # size(value) -> Symbol, String, or nil
38
+ #
31
39
  # Specifies the size of the bubble.
32
- # @!method size(value)
33
- # @param value [Symbol, String, nil] Bubble size. Keywords: `:nano`, `:micro`,
34
- # `:kilo`, `:mega`, `:giga`. Pixel/percentage values are not directly
35
- # supported for bubble size by LINE; use keywords.
36
- # @return [Symbol, String, nil] The current bubble size.
40
+ #
41
+ # [value]
42
+ # Bubble size. Keywords: <code>:nano</code>, <code>:micro</code>,
43
+ # <code>:kilo</code>, <code>:mega</code>, <code>:giga</code>.
44
+ # Pixel/percentage values are not directly supported for bubble
45
+ # size by LINE; use keywords.
37
46
  option :size, default: nil # E.g., :nano, :micro, :kilo, :mega, :giga
38
47
 
48
+ # :method: styles
49
+ #
50
+ # :call-seq:
51
+ # styles() -> Hash or nil
52
+ # styles(value) -> Hash or nil
53
+ #
39
54
  # Defines custom styles for the bubble and its sections (header, hero, body, footer).
40
- # @!method styles(value)
41
- # @param value [Hash, nil] A hash defining style overrides.
42
- # See LINE API documentation for the structure of the styles object.
43
- # @return [Hash, nil] The current styles hash.
44
- # @example
45
- # bubble.styles(
46
- # header: { backgroundColor: "#FF0000" },
47
- # body: { separator: true, separatorColor: "#00FF00" }
48
- # )
55
+ #
56
+ # [value]
57
+ # A hash defining style overrides. See LINE API documentation
58
+ # for the structure of the styles object.
59
+ #
60
+ # == Example
61
+ #
62
+ # bubble.styles(
63
+ # header: { backgroundColor: "#FF0000" },
64
+ # body: { separator: true, separatorColor: "#00FF00" }
65
+ # )
49
66
  option :styles, default: nil
50
67
 
51
68
  # Initializes a new Flex Message Bubble container.
52
69
  # The provided block is instance-eval'd, allowing DSL methods for defining
53
- # sections (e.g., {#header}, {#body}) to be called.
70
+ # sections (e.g., #header, #body) to be called.
54
71
  #
55
- # @param context [Object, nil] An optional context for the builder.
56
- # @param options [Hash] A hash of options to set instance variables
57
- # (e.g., `:size`, `:styles`).
58
- # @param block [Proc, nil] A block to define the sections of this bubble.
72
+ # [context]
73
+ # An optional context for the builder.
74
+ # [option]
75
+ # A hash of options to set instance variables (e.g., <code>:size</code>, <code>:styles</code>).
76
+ # [block]
77
+ # A block to define the sections of this bubble.
59
78
  def initialize(context: nil, **options, &)
60
79
  @header = nil
61
80
  @hero = nil
@@ -65,57 +84,64 @@ module Line
65
84
  super # Calls Base#initialize, sets options, and evals block
66
85
  end
67
86
 
68
- # Defines the header section of the bubble using a {Box} component.
87
+ # Defines the header section of the bubble using a Box component.
69
88
  #
70
- # @param options [Hash] Options for the header Box. See {Box#initialize}.
71
- # @param block [Proc] A block to define the contents of the header Box.
72
- # @return [Flex::Box] The newly created Box object for the header.
89
+ # [option]
90
+ # Options for the header Box. See Box#initialize.
91
+ # [block]
92
+ # A block to define the contents of the header Box.
73
93
  def header(**options, &)
74
94
  @header = Box.new(**options, context: context, &)
75
95
  end
76
96
 
77
- # Defines the hero section of the bubble using a {Box} component.
97
+ # Defines the hero section of the bubble using a Box component.
78
98
  # The hero section is typically used for prominent content like a large image or video.
79
99
  #
80
- # @param options [Hash] Options for the hero Box. See {Box#initialize}.
81
- # @param block [Proc] A block to define the contents of the hero Box.
82
- # @return [Flex::Box] The newly created Box object for the hero section.
100
+ # [option]
101
+ # Options for the hero Box. See Box#initialize.
102
+ # [block]
103
+ # A block to define the contents of the hero Box.
83
104
  def hero(**options, &)
84
105
  @hero = Box.new(**options, context: context, &)
85
106
  end
86
107
 
87
- # Defines the hero section of the bubble using an {Image} component.
108
+ # Defines the hero section of the bubble using an Image component.
88
109
  # This is a convenience method for common cases where the hero is a single image.
89
110
  #
90
- # @param url [String] The URL of the image.
91
- # @param options [Hash] Options for the Image component. See {Image#initialize}.
92
- # @param block [Proc, nil] An optional block for the Image component (e.g., for an action).
93
- # @return [Flex::Image] The newly created Image object for the hero section.
111
+ # [url]
112
+ # The URL of the image.
113
+ # [option]
114
+ # Options for the Image component. See Image#initialize.
115
+ # [block]
116
+ # An optional block for the Image component (e.g., for an action).
94
117
  def hero_image(url, **options, &)
95
118
  @hero = Image.new(url, **options, context: context, &)
96
119
  end
97
120
 
98
- # Defines the body section of the bubble using a {Box} component.
121
+ # Defines the body section of the bubble using a Box component.
99
122
  # This is the main content area of the bubble.
100
123
  #
101
- # @param options [Hash] Options for the body Box. See {Box#initialize}.
102
- # @param block [Proc] A block to define the contents of the body Box.
103
- # @return [Flex::Box] The newly created Box object for the body.
124
+ # [option]
125
+ # Options for the body Box. See Box#initialize.
126
+ # [block]
127
+ # A block to define the contents of the body Box.
104
128
  def body(**options, &)
105
129
  @body = Box.new(**options, context: context, &)
106
130
  end
107
131
 
108
- # Defines the footer section of the bubble using a {Box} component.
132
+ # Defines the footer section of the bubble using a Box component.
109
133
  #
110
- # @param options [Hash] Options for the footer Box. See {Box#initialize}.
111
- # @param block [Proc] A block to define the contents of the footer Box.
112
- # @return [Flex::Box] The newly created Box object for the footer.
134
+ # [option]
135
+ # Options for the footer Box. See Box#initialize.
136
+ # [block]
137
+ # A block to define the contents of the footer Box.
113
138
  def footer(**options, &)
114
139
  @footer = Box.new(**options, context: context, &)
115
140
  end
116
141
 
117
142
  private
118
143
 
144
+ # :nodoc:
119
145
  def to_api
120
146
  {
121
147
  type: "bubble",
@@ -128,6 +154,7 @@ module Line
128
154
  }.compact
129
155
  end
130
156
 
157
+ # :nodoc:
131
158
  def to_sdkv2
132
159
  {
133
160
  type: "bubble",
@@ -4,50 +4,59 @@ module Line
4
4
  module Message
5
5
  module Builder
6
6
  module Flex
7
- # The `Builder` class is the main entry point for constructing a complete
7
+ # The +Builder+ class is the main entry point for constructing a complete
8
8
  # LINE Flex Message. A Flex Message is a highly customizable message type
9
9
  # that can contain one main content element, which is either a single
10
- # {Bubble} or a {Carousel} of bubbles.
10
+ # Bubble or a Carousel of bubbles.
11
11
  #
12
- # This builder requires `alt_text` (alternative text) for accessibility and
12
+ # This builder requires +alt_text+ (alternative text) for accessibility and
13
13
  # for display on devices or LINE versions that cannot render Flex Messages.
14
- # It can also have a `quickReply` attached to it.
14
+ # It can also have a +quickReply+ attached to it.
15
15
  #
16
- # @example Creating a Flex Message with a single bubble
17
- # Line::Message::Builder.with do |root|
18
- # root.flex alt_text: "My Product" do |flex_builder| # flex_builder is an instance of Flex::Builder
19
- # flex_builder.bubble size: :giga do |bubble_content|
20
- # bubble_content.hero_image "https://example.com/product.jpg"
21
- # bubble_content.body do |b|
22
- # b.text "Product Name", weight: :bold, size: :xl
16
+ # === Example: Creating a Flex Message with a single bubble
17
+ #
18
+ # Line::Message::Builder.with do
19
+ # flex alt_text: "My Product" do
20
+ # flex_builder.bubble size: :giga do
21
+ # hero_image "https://example.com/product.jpg"
22
+ # body do
23
+ # text "Product Name", weight: :bold, size: :xl
23
24
  # end
24
25
  # end
25
- # flex_builder.quick_reply do |qr|
26
- # qr.button action: :message, label: "Learn More", text: "Tell me more"
26
+ # quick_reply do
27
+ # button action: :message, label: "Learn More", text: "Tell me more"
27
28
  # end
28
29
  # end
29
30
  # end
30
31
  #
31
- # @see https://developers.line.biz/en/reference/messaging-api/#flex-messages
32
- # @see Bubble
33
- # @see Carousel
34
- # @see QuickReply
32
+ # See also:
33
+ # - https://developers.line.biz/en/reference/messaging-api/#flex-messages
34
+ # - Bubble
35
+ # - Carousel
36
+ # - QuickReply
35
37
  class Builder < Line::Message::Builder::Base
36
38
  # Alternative text for the Flex Message. Displayed on devices that
37
39
  # cannot render Flex Messages or used for accessibility.
38
40
  # This is a required field for a valid Flex Message.
39
- # @!method alt_text(value)
40
- # @param value [String, nil] The alternative text. Max 400 characters.
41
- # @return [String, nil] The current alternative text.
41
+ #
42
+ # :method: alt_text
43
+ # :call-seq:
44
+ # alt_text(value) -> String, nil
45
+ #
46
+ # [value]
47
+ # The alternative text. Max 400 characters.
42
48
  option :alt_text, default: nil
43
49
 
44
50
  # Initializes a new Flex Message Builder.
45
51
  # The provided block is instance-eval'd, allowing DSL methods like
46
- # {#bubble} or {#carousel} to define the main content.
52
+ # #bubble or #carousel to define the main content.
47
53
  #
48
- # @param context [Object, nil] An optional context for the builder.
49
- # @param options [Hash] A hash of options to set instance variables (e.g., `:alt_text`).
50
- # @param block [Proc, nil] A block to define the content (bubble or carousel)
54
+ # [context]
55
+ # An optional context for the builder.
56
+ # [option]
57
+ # A hash of options to set instance variables (e.g., <code>:alt_text</code>).
58
+ # [block]
59
+ # A block to define the content (bubble or carousel)
51
60
  # of this Flex Message.
52
61
  def initialize(context: nil, **options, &)
53
62
  @contents = nil # Will hold either a Bubble or Carousel instance
@@ -55,29 +64,31 @@ module Line
55
64
  super # Calls Base#initialize, sets options (like @alt_text), and evals block
56
65
  end
57
66
 
58
- # Defines the content of this Flex Message as a single {Bubble}.
59
- # If called, this will overwrite any previously defined `carousel` content.
67
+ # Defines the content of this Flex Message as a single Bubble.
68
+ # If called, this will overwrite any previously defined +carousel+ content.
60
69
  #
61
- # @param options [Hash] Options for the Bubble. See {Bubble#initialize}.
62
- # @param block [Proc] A block to define the sections of the Bubble.
63
- # @return [Flex::Bubble] The newly created Bubble object.
70
+ # [option]
71
+ # Options for the Bubble. See Bubble#initialize.
72
+ # [block]
73
+ # A block to define the sections of the Bubble.
64
74
  def bubble(**options, &)
65
75
  @contents = Line::Message::Builder::Flex::Bubble.new(context: context, **options, &)
66
76
  end
67
77
 
68
- # Defines the content of this Flex Message as a {Carousel} of bubbles.
69
- # If called, this will overwrite any previously defined `bubble` content.
78
+ # Defines the content of this Flex Message as a Carousel of bubbles.
79
+ # If called, this will overwrite any previously defined +bubble+ content.
70
80
  #
71
- # @param options [Hash] Options for the Carousel. See {Carousel#initialize}.
72
- # @param block [Proc] A block to define the bubbles within the Carousel.
73
- # @return [Flex::Carousel] The newly created Carousel object.
81
+ # [option]
82
+ # Options for the Carousel. See Carousel#initialize.
83
+ # [block]
84
+ # A block to define the bubbles within the Carousel.
74
85
  def carousel(**options, &)
75
86
  @contents = Line::Message::Builder::Flex::Carousel.new(context: context, **options, &)
76
87
  end
77
88
 
78
89
  private
79
90
 
80
- def to_api
91
+ def to_api # :nodoc:
81
92
  raise Error, "Flex Message contents (bubble or carousel) must be defined." if @contents.nil?
82
93
 
83
94
  {
@@ -88,7 +99,7 @@ module Line
88
99
  }.compact
89
100
  end
90
101
 
91
- def to_sdkv2
102
+ def to_sdkv2 # :nodoc:
92
103
  raise Error, "Flex Message contents (bubble or carousel) must be defined." if @contents.nil?
93
104
 
94
105
  {
@@ -6,73 +6,128 @@ module Line
6
6
  module Flex
7
7
  # Represents a "button" component in a LINE Flex Message.
8
8
  #
9
- # Buttons are interactive elements that users can tap to trigger an {Actionable#action action}
9
+ # Buttons are interactive elements that users can tap to trigger an action
10
10
  # (e.g., open a URL, send a message, or trigger a postback). They have
11
- # various styling options, including `style` (primary, secondary, link) and
12
- # `height`.
11
+ # various styling options, including +style+ (primary, secondary, link),
12
+ # +color+ and +height+.
13
13
  #
14
14
  # An action is mandatory for a button component.
15
15
  #
16
- # @example Creating a button that sends a message
17
- # Line::Message::Builder.with do |root|
18
- # root.flex alt_text: "Button Example" do |flex|
19
- # flex.bubble do |bubble|
20
- # bubble.body do |body_box|
21
- # body_box.button style: :primary, height: :sm do |btn|
22
- # btn.message "Buy Now", label: "Buy" # Action definition
16
+ # Buttons have no padding properties of their own; use the padding of the
17
+ # surrounding Box to inset a button.
18
+ #
19
+ # == Example
20
+ #
21
+ # Line::Message::Builder.with do
22
+ # flex alt_text: "Button Example" do
23
+ # bubble do
24
+ # body do
25
+ # button style: :primary, height: :sm do
26
+ # message "Buy Now", label: "Buy" # Action definition
27
+ # end
28
+ # end
29
+ # end
30
+ # end
31
+ # end
32
+ #
33
+ # === Example: Tinting a primary button
34
+ #
35
+ # Line::Message::Builder.with do
36
+ # flex alt_text: "Button Example" do
37
+ # bubble do
38
+ # body do
39
+ # button style: :primary, color: "#1DB446" do
40
+ # message "Buy Now", label: "Buy"
23
41
  # end
24
42
  # end
25
43
  # end
26
44
  # end
27
45
  # end
28
46
  #
29
- # @see https://developers.line.biz/en/reference/messaging-api/#button
30
- # @see Actionable For defining the button's action (mandatory).
31
- # @see Position::Vertical For `gravity` property.
32
- # @see Position::Padding For padding properties.
33
- # @see Position::Margin For margin property.
34
- # @see Position::Offset For offset properties.
35
- # @see Size::Flex For flex sizing property.
36
- # @see Size::AdjustMode For `adjust_mode` property.
47
+ # See also:
48
+ # - https://developers.line.biz/en/reference/messaging-api/#button
49
+ # - Actionable for defining the button's action (mandatory)
50
+ # - Position::Vertical for +gravity+ property
51
+ # - Position::Margin for +margin+ property
52
+ # - Position::Offset for offset properties
53
+ # - Size::Flex for flex sizing property
54
+ # - Size::AdjustMode for +adjust_mode+ property
37
55
  class Button < Line::Message::Builder::Base
38
56
  include Actionable # Defines the action performed when the button is tapped.
39
57
  include Position::Vertical # Adds `gravity` option for vertical alignment.
40
- include Position::Padding # Adds padding options.
41
58
  include Position::Margin # Adds `margin` option.
42
59
  include Position::Offset # Adds offset options.
43
60
  include Size::Flex # Adds `flex` option for sizing within a parent box.
44
61
  include Size::AdjustMode # Adds `adjust_mode` option.
45
62
 
46
- # Specifies the style of the button.
47
- # @!method style(value)
48
- # @param value [Symbol, String] Button style.
49
- # Can be `:primary`, `:secondary`, `:link` (default).
50
- # String values should match these keywords.
51
- # @return [Symbol, String] The current button style.
63
+ # :method: style
64
+ # :call-seq:
65
+ # style() -> Symbol
66
+ # style(value) -> Symbol
67
+ #
68
+ # Sets or gets the button style.
69
+ #
70
+ # [value]
71
+ # Button style. Can be +:primary+, +:secondary+, or +:link+ (default).
72
+ # String values should match these keywords.
52
73
  option :style, default: :link
53
74
 
54
- # Specifies the height of the button.
55
- # @!method height(value)
56
- # @param value [Symbol, String] Button height.
57
- # Can be `:sm` (small) or `:md` (medium, default).
58
- # @return [Symbol, String] The current button height.
75
+ # :method: height
76
+ # :call-seq:
77
+ # height() -> Symbol
78
+ # height(value) -> Symbol
79
+ #
80
+ # Sets or gets the button height.
81
+ #
82
+ # [value]
83
+ # Button height. Can be +:sm+ (small) or +:md+ (medium, default).
59
84
  option :height, default: :md, validator: Validators::Enum.new(:sm, :md)
60
85
 
86
+ # :method: color
87
+ # :call-seq:
88
+ # color() -> String or nil
89
+ # color(value) -> String
90
+ #
91
+ # Sets or gets the button color. This is the character color when
92
+ # +style+ is <code>:link</code>, and the background color when +style+
93
+ # is <code>:primary</code> or <code>:secondary</code>.
94
+ #
95
+ # [value]
96
+ # Hexadecimal color code (e.g., <code>"#RRGGBB"</code>)
97
+ option :color, default: nil
98
+
99
+ # :method: scaling
100
+ # :call-seq:
101
+ # scaling() -> Boolean or nil
102
+ # scaling(value) -> Boolean
103
+ #
104
+ # Sets or gets whether the label font size follows the font size setting
105
+ # of the LINE app.
106
+ #
107
+ # [value]
108
+ # +true+ to scale the font size, +false+ (default) to keep it fixed
109
+ option :scaling, default: nil
110
+
61
111
  # Initializes a new Flex Message Button component.
112
+ #
62
113
  # The provided block is instance-eval'd, primarily used to define the
63
- # button's action using methods from the {Actionable} module (e.g., `message "label"`).
114
+ # button's action using methods from the Actionable module (e.g., +message+).
64
115
  #
65
- # @param context [Object, nil] An optional context for the builder.
66
- # @param options [Hash] A hash of options to set instance variables
67
- # (e.g., `:style`, `:height`, and options from included modules).
68
- # @param block [Proc, nil] A block to define the button's action and other properties.
69
- # This block is where you should call an action method like `message` or `postback`.
116
+ # [context]
117
+ # An optional context for the builder
118
+ # [options]
119
+ # A hash of options to set instance variables
120
+ # (e.g., +:style+, +:height+, and options from included modules)
121
+ # [block]
122
+ # A block to define the button's action and other properties.
123
+ # This block is where you should call an action method like +message+ or +postback+.
70
124
  def initialize(context: nil, **options, &)
71
125
  super # Calls Base#initialize, sets options, and evals block (which should define the action)
72
126
  end
73
127
 
74
128
  private
75
129
 
130
+ # :nodoc:
76
131
  def to_api # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
77
132
  raise RequiredError, "action is required for a button" if action.nil?
78
133
 
@@ -81,14 +136,10 @@ module Line
81
136
  action: action.to_h, # From Actionable module
82
137
  style: style, # From option
83
138
  height: height, # From option
139
+ color: color, # From option
140
+ scaling: scaling, # From option
84
141
  # Position::Vertical
85
142
  gravity: gravity,
86
- # Position::Padding
87
- paddingAll: padding || padding_all,
88
- paddingTop: padding_top,
89
- paddingBottom: padding_bottom,
90
- paddingStart: padding_start,
91
- paddingEnd: padding_end,
92
143
  # Position::Margin
93
144
  margin: margin,
94
145
  # Position::Offset
@@ -104,6 +155,7 @@ module Line
104
155
  }.compact
105
156
  end
106
157
 
158
+ # :nodoc:
107
159
  def to_sdkv2 # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
108
160
  raise RequiredError, "action is required for a button" if action.nil?
109
161
 
@@ -112,14 +164,10 @@ module Line
112
164
  action: action.to_h, # From Actionable module
113
165
  style: style, # From option
114
166
  height: height, # From option
167
+ color: color, # From option
168
+ scaling: scaling, # From option
115
169
  # Position::Vertical
116
170
  gravity: gravity,
117
- # Position::Padding
118
- padding_all: padding || padding_all,
119
- padding_top: padding_top,
120
- padding_bottom: padding_bottom,
121
- padding_start: padding_start,
122
- padding_end: padding_end,
123
171
  # Position::Margin
124
172
  margin: margin,
125
173
  # Position::Offset