Class: Numo::Gnuplot::OptsToS
- Inherits:
-
Object
- Object
- Numo::Gnuplot::OptsToS
- Defined in:
- lib/numo/gnuplot.rb
Instance Method Summary collapse
-
#initialize(*opts) ⇒ OptsToS
constructor
:nodoc: all.
- #opts_to_s(*opts) ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(*opts) ⇒ OptsToS
:nodoc: all
303 304 305 |
# File 'lib/numo/gnuplot.rb', line 303 def initialize(*opts) @opts = opts end |
Instance Method Details
#opts_to_s(*opts) ⇒ Object
311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 |
# File 'lib/numo/gnuplot.rb', line 311 def opts_to_s(*opts) #p opts sep = "," opts.map do |opt| sep = " " if !opt.kind_of?(Numeric) case opt when Array opt.map{|v| "#{opts_to_s(*v)}"}.join(sep) when Hash opt.map{|k,v| KvItem.new(k,v).to_s}.compact.join(" ") when Range "[#{opt.begin}:#{opt.end}]" else opt.to_s end end.join(sep) end |
#to_s ⇒ Object
307 308 309 |
# File 'lib/numo/gnuplot.rb', line 307 def to_s opts_to_s(*@opts) end |