Class: Chartism::Line::Options
- Inherits:
-
Object
- Object
- Chartism::Line::Options
- Defined in:
- lib/chartism/line/options.rb
Instance Method Summary collapse
- #area(value = nil, &block) ⇒ Object
-
#initialize ⇒ Options
constructor
A new instance of Options.
- #options ⇒ Object
- #points(value = nil, &block) ⇒ Object
- #smooth(value = nil, &block) ⇒ Object
Constructor Details
#initialize ⇒ Options
Returns a new instance of Options.
4 5 6 7 8 9 10 |
# File 'lib/chartism/line/options.rb', line 4 def initialize @options = { showPoint: true, lineSmooth: true, showArea: false } end |
Instance Method Details
#area(value = nil, &block) ⇒ Object
22 23 24 25 |
# File 'lib/chartism/line/options.rb', line 22 def area value=nil, &block @options[:showArea] = value unless value.nil? @options[:showArea] = instance_eval(&block) if block_given? end |
#options ⇒ Object
27 28 29 |
# File 'lib/chartism/line/options.rb', line 27 def @options end |
#points(value = nil, &block) ⇒ Object
12 13 14 15 |
# File 'lib/chartism/line/options.rb', line 12 def points value=nil, &block @options[:showPoint] = value @options[:showPoint] = instance_eval(&block) if block_given? end |
#smooth(value = nil, &block) ⇒ Object
17 18 19 20 |
# File 'lib/chartism/line/options.rb', line 17 def smooth value=nil, &block @options[:lineSmooth] = value unless value.nil? @options[:lineSmooth] = instance_eval(&block) if block_given? end |