Class: RTree::Style
- Inherits:
-
RTreeStyleBase
- Object
- RTreeStyleBase
- RTree::Style
- Defined in:
- lib/rtree.rb
Overview
A Ruby wrapper around RTree styles, used in PostScript plotting. in particular by #postscript.
Class Method Summary collapse
-
.from_a(array) ⇒ RTree::Style
(also: from_array)
Create a new Style instance from array of Hash.
-
.from_json(json) ⇒ RTree::Style
Create a new Style instance from JSON string.
-
.json_read(io_arg) ⇒ RTree::Style
Create a new Style instance from JSON path or stream.
Class Method Details
.from_a(array) ⇒ RTree::Style Also known as: from_array
Create a new Style instance from array of Hash
630 631 632 |
# File 'lib/rtree.rb', line 630 def from_a(array) from_json(array.to_json) end |
.from_json(json) ⇒ RTree::Style
Create a new Style instance from JSON string
606 607 608 |
# File 'lib/rtree.rb', line 606 def from_json(json) deserialise(json, Encoding::UTF_8) { |io| json_read(io) } end |
.json_read(io_arg) ⇒ RTree::Style
Create a new Style instance from JSON path or stream
597 598 599 |
# File 'lib/rtree.rb', line 597 def json_read(io_arg) RTree::IOUtil.io_with_mode(io_arg, 'r') { |io| super(io) } end |