Class: Nyaplot::Charts::ChartBase
- Inherits:
-
Object
- Object
- Nyaplot::Charts::ChartBase
- Defined in:
- lib/nyaplot/charts/base.rb
Instance Attribute Summary collapse
-
#deps ⇒ Object
readonly
Returns the value of attribute deps.
-
#glyphs ⇒ Object
readonly
Returns the value of attribute glyphs.
-
#xdomain ⇒ Object
readonly
Returns the value of attribute xdomain.
-
#ydomain ⇒ Object
readonly
Returns the value of attribute ydomain.
Class Method Summary collapse
Instance Method Summary collapse
- #create ⇒ Object
-
#initialize(**opts) ⇒ ChartBase
constructor
A new instance of ChartBase.
Constructor Details
#initialize(**opts) ⇒ ChartBase
Returns a new instance of ChartBase.
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/nyaplot/charts/base.rb', line 16 def initialize(**opts) @glyphs = [] @deps = [] @@needs.each do |sym| raise "lack argument " + sym.to_s if opts[sym].nil? end create(**opts) end |
Instance Attribute Details
#deps ⇒ Object (readonly)
Returns the value of attribute deps.
15 16 17 |
# File 'lib/nyaplot/charts/base.rb', line 15 def deps @deps end |
#glyphs ⇒ Object (readonly)
Returns the value of attribute glyphs.
15 16 17 |
# File 'lib/nyaplot/charts/base.rb', line 15 def glyphs @glyphs end |
#xdomain ⇒ Object (readonly)
Returns the value of attribute xdomain.
15 16 17 |
# File 'lib/nyaplot/charts/base.rb', line 15 def xdomain @xdomain end |
#ydomain ⇒ Object (readonly)
Returns the value of attribute ydomain.
15 16 17 |
# File 'lib/nyaplot/charts/base.rb', line 15 def ydomain @ydomain end |
Class Method Details
.allow(x, y) ⇒ Object
5 6 7 8 |
# File 'lib/nyaplot/charts/base.rb', line 5 def allow(x, y) @@allow_x = x @@allow_y = y end |
.need(*args) ⇒ Object
10 11 12 |
# File 'lib/nyaplot/charts/base.rb', line 10 def need(*args) @@needs = args end |
Instance Method Details
#create ⇒ Object
27 28 29 |
# File 'lib/nyaplot/charts/base.rb', line 27 def create ## over-write this end |