Class: LazyHighCharts::HighChartGlobals
- Inherits:
-
Object
- Object
- LazyHighCharts::HighChartGlobals
- Includes:
- LayoutHelper
- Defined in:
- lib/lazy_high_charts/high_chart_globals.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize ⇒ HighChartGlobals
constructor
A new instance of HighChartGlobals.
- #merge_options(name, opts) ⇒ Object
-
#method_missing(meth, opts = {}) ⇒ Object
For instance:
high_chart_globals.global(:useUTC => false)
.
Methods included from LayoutHelper
#high_chart, #high_chart_globals, #high_graph, #high_graph_stock, #high_stock
Constructor Details
#initialize ⇒ HighChartGlobals
Returns a new instance of HighChartGlobals.
7 8 9 10 11 12 |
# File 'lib/lazy_high_charts/high_chart_globals.rb', line 7 def initialize self.tap do |chart_globals| chart_globals. ||= {} yield chart_globals if block_given? end end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(meth, opts = {}) ⇒ Object
For instance: high_chart_globals.global(:useUTC => false)
17 18 19 20 21 22 |
# File 'lib/lazy_high_charts/high_chart_globals.rb', line 17 def method_missing(meth, opts = {}) if meth.to_s == 'to_ary' super end meth, opts end |
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
5 6 7 |
# File 'lib/lazy_high_charts/high_chart_globals.rb', line 5 def @options end |
Instance Method Details
#merge_options(name, opts) ⇒ Object
24 25 26 |
# File 'lib/lazy_high_charts/high_chart_globals.rb', line 24 def (name, opts) @options.merge! name => opts end |