| 1 | package LINE::Bot::API::Builder::FlexMessage; | ||
| 2 | |||
| 3 | use strict; | ||
| 4 | use warnings; | ||
| 5 | |||
| 6 | sub new { | ||
| 7 | my ($class, %args) = @_; | ||
| 8 | die "`json` attribute is required" unless defined $args{json}; | ||
| 9 | return bless { _json => $args{json} }, $class; | ||
| 10 | } | ||
| 11 | |||
| 12 | sub build { | ||
| 13 | my ($self) = @_; | ||
| 14 | return $self->{_build} //= decode_json($self->{_json}); | ||
| 15 | } | ||
| 16 | |||
| 17 | 1; | ||
| 18 | |||
| 19 | __END__ |