Class: Rust::Plots::GGPlot::Theme::Element
- Inherits:
-
Object
- Object
- Rust::Plots::GGPlot::Theme::Element
show all
- Defined in:
- lib/rust/external/ggplot2/themes.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(**options) ⇒ Element
87
88
89
|
# File 'lib/rust/external/ggplot2/themes.rb', line 87
def initialize(**options)
@options = options
end
|
Instance Attribute Details
Returns the value of attribute options.
85
86
87
|
# File 'lib/rust/external/ggplot2/themes.rb', line 85
def options
@options
end
|
Instance Method Details
#r_function ⇒ Object
91
92
93
|
# File 'lib/rust/external/ggplot2/themes.rb', line 91
def r_function
raise "Not implemented for generic theme element"
end
|
104
105
106
107
108
|
# File 'lib/rust/external/ggplot2/themes.rb', line 104
def to_h
hash = @options.clone
hash['_type'] = self.class.name
return hash
end
|
95
96
97
98
99
100
101
102
|
# File 'lib/rust/external/ggplot2/themes.rb', line 95
def to_R
options = @options.map { |k, v| [k.to_s.gsub("_", "."), v] }.to_h
function = Rust::Function.new(self.r_function)
function.options = Rust::Options.from_hash(options)
return function.to_R
end
|