diff options
author | Matias Linares <matiaslina@gmail.com> | 2018-08-04 18:54:22 -0300 |
---|---|---|
committer | Matias Linares <matiaslina@gmail.com> | 2018-08-04 18:54:22 -0300 |
commit | 007f12ce41d0331f3d2e2d70f358fb2793d7599a (patch) | |
tree | 77ad6f5fec2ae4088e5300e1dcaec08167f1d4cb /lib/Matrix/Client/Room.pm6 | |
parent | 6d19d6e43896d84e499020ba0b6f380acdfe7f70 (diff) | |
download | perl6-matrix-client-007f12ce41d0331f3d2e2d70f358fb2793d7599a.tar.gz |
use TWEAK instead of BUILD
Diffstat (limited to 'lib/Matrix/Client/Room.pm6')
-rw-r--r-- | lib/Matrix/Client/Room.pm6 | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/lib/Matrix/Client/Room.pm6 b/lib/Matrix/Client/Room.pm6 index 6897b8d..efbca06 100644 --- a/lib/Matrix/Client/Room.pm6 +++ b/lib/Matrix/Client/Room.pm6 @@ -7,17 +7,8 @@ unit class Matrix::Client::Room does Matrix::Client::Requester; has $!name; has $.id; -multi submethod BUILD(Str :$!id!, :$!home-server!, :$!access-token!, :$json?) { +submethod TWEAK { $!url-prefix = "/rooms/$!id"; - - if so $json { - my @events = $json<state><events>.clone; - for @events -> $ev { - if $ev<type> eq "m.room.name" { - $!name = $ev<content><name>; - } - } - } } method !get-name() { |