View Source Plantuml.Encoding behaviour (Plantuml v0.1.1)
This module provides functions to encode/decode PlantUML's diagrams.
See PlantUML's Documentation on text encoding.
Link to this section Summary
Link to this section Callbacks
Link to this section Functions
Decodes an encoded diagram.
options
Options
:method
- the encoding method, can be either:deflate
or:hex
. Defaults to:deflate
examples
Examples
iex> Plantuml.Encoding.decode("Syp9J4vLqBLJSCfFib9mB2t9ICqhoKnEBCdCprC8IYqiJIqkuGBAAUW2rJY256DHLLoGdrUSoWK0")
"Alice -> Bob: Authentication Request\nBob --> Alice: Authentication Response\n"
iex> Plantuml.Encoding.decode("416C696365202D3E20426F623A2041757468656E7469636174696F6E20526571756573740A426F62202D2D3E20416C6963653A2041757468656E7469636174696F6E20526573706F6E73650A", method: :hex)
"Alice -> Bob: Authentication Request\nBob --> Alice: Authentication Response\n"
Encodes a diagram.
options
Options
:method
- the encoding method, can be either:deflate
or:hex
. Defaults to:deflate
examples
Examples
iex> Plantuml.Encoding.encode("Alice -> Bob: Authentication Request\nBob --> Alice: Authentication Response\n")
"Syp9J4vLqBLJSCfFib9mB2t9ICqhoKnEBCdCprC8IYqiJIqkuGBAAUW2rJY256DHLLoGdrUSoWK0"
iex> Plantuml.Encoding.encode("Alice -> Bob: Authentication Request\nBob --> Alice: Authentication Response\n", method: :hex)
"416C696365202D3E20426F623A2041757468656E7469636174696F6E20526571756573740A426F62202D2D3E20416C6963653A2041757468656E7469636174696F6E20526573706F6E73650A"