Class: Rust::Plots::GGPlot::Layer
- Defined in:
- lib/rust/external/ggplot2/core.rb
Direct Known Subclasses
AxisScaler, ExistingTheme, FlipCoordinates, Geom, Labels, Theme
Instance Method Summary collapse
-
#initialize(function_name, **options) ⇒ Layer
constructor
A new instance of Layer.
- #option(key, value) ⇒ Object
- #to_R ⇒ Object
Constructor Details
#initialize(function_name, **options) ⇒ Layer
Returns a new instance of Layer.
15 16 17 18 19 |
# File 'lib/rust/external/ggplot2/core.rb', line 15 def initialize(function_name, **) @function_name = function_name @arguments = Rust::Arguments.new = Rust::Options.from_hash() end |
Instance Method Details
#option(key, value) ⇒ Object
21 22 23 |
# File 'lib/rust/external/ggplot2/core.rb', line 21 def option(key, value) [key] = value end |
#to_R ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/rust/external/ggplot2/core.rb', line 25 def to_R if !block_given? , arguments = , @arguments else , arguments = yield(, @arguments) end = Rust::Options.from_hash() unless .is_a?(Rust::Options) function = Rust::Function.new(@function_name) function.arguments = arguments if arguments function. = if return function.to_R end |