Class: Mural::Widget::Arrow::Label
- Inherits:
-
Object
- Object
- Mural::Widget::Arrow::Label
- Includes:
- Codec
- Defined in:
- lib/mural/widget/arrow.rb
Defined Under Namespace
Class Method Summary collapse
Instance Method Summary collapse
Methods included from Codec
Class Method Details
.decode(json) ⇒ Object
78 79 80 81 82 83 84 85 86 87 88 89 |
# File 'lib/mural/widget/arrow.rb', line 78 def self.decode(json) super.tap do |label| next if label.nil? label.labels = label.labels.map do |l| # I'm not responsible for this naming… Mural::Widget::Arrow::Label::Label.decode(l) end label.format = Format.decode(label.format) end end |
Instance Method Details
#encode ⇒ Object
91 92 93 94 95 96 |
# File 'lib/mural/widget/arrow.rb', line 91 def encode super.tap do |json| json['format'] = json['format']&.encode json['labels']&.map!(&:encode) end.compact end |