Module: Nyaplot::Jsonizable
- Included in:
- CircularPlot, Diagram, Diagram3D, Diagrams3D::ArrayType, Diagrams3D::Line, Diagrams3D::MatrixType, Diagrams3D::Particles, Diagrams3D::Scatter, Diagrams3D::Surface, Diagrams3D::Wireframe, Diagrams::Arc, Diagrams::Bar, Diagrams::Box, Diagrams::Connector, Diagrams::Heatmap, Diagrams::Histogram, Diagrams::Labels, Diagrams::Line, Diagrams::Scatter, Diagrams::Vectors, Diagrams::Venn, Frame, MapPlot, Plot, Plot3D
- Defined in:
- lib/nyaplot/base.rb
Overview
The module to be included by internal classes
Defined Under Namespace
Modules: ClassMethod
Class Method Summary collapse
Instance Method Summary collapse
- #before_to_json ⇒ Object
-
#get_property(symbol) ⇒ Object
Prepared to expressly get property.
-
#init_properties ⇒ Object
This method should be excuted when initializing class includes Jsonizable.
-
#set_property(symbol, val) ⇒ Object
Prepared to expressly set property.
- #to_json(*args) ⇒ Object
Class Method Details
.included(cls) ⇒ Object
8 9 10 |
# File 'lib/nyaplot/base.rb', line 8 def self.included(cls) cls.extend ClassMethod end |
Instance Method Details
#before_to_json ⇒ Object
12 13 |
# File 'lib/nyaplot/base.rb', line 12 def before_to_json end |
#get_property(symbol) ⇒ Object
Prepared to expressly get property
31 32 33 |
# File 'lib/nyaplot/base.rb', line 31 def get_property(symbol) self.send(symbol) end |
#init_properties ⇒ Object
This method should be excuted when initializing class includes Jsonizable
16 17 18 |
# File 'lib/nyaplot/base.rb', line 16 def init_properties @properties = {} end |
#set_property(symbol, val) ⇒ Object
Prepared to expressly set property
26 27 28 |
# File 'lib/nyaplot/base.rb', line 26 def set_property(symbol, val) self.send(symbol, val) end |
#to_json(*args) ⇒ Object
20 21 22 23 |
# File 'lib/nyaplot/base.rb', line 20 def to_json(*args) before_to_json @properties.to_json end |