Class: Grada::Gnuplot::Style

Inherits:
Object
  • Object
show all
Defined in:
lib/grada/types/gnuplot.rb

Constant Summary collapse

STYLES =
[:ls, :lt, :lw, :lc, :pt, :ps, :fs]

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize {|_self| ... } ⇒ Style

Returns a new instance of Style.

Yields:

  • (_self)

Yield Parameters:



143
144
145
146
147
148
149
150
# File 'lib/grada/types/gnuplot.rb', line 143

def initialize
  STYLES.each do |style|
    send("#{style}=", nil)
  end
  
  yield self if block_given?
  
end

Instance Attribute Details

#fillObject Also known as: fs

Returns the value of attribute fill.



118
119
120
# File 'lib/grada/types/gnuplot.rb', line 118

def fill
  @fill
end

#indexObject

Returns the value of attribute index.



118
119
120
# File 'lib/grada/types/gnuplot.rb', line 118

def index
  @index
end

#linecolorObject Also known as: lc

Returns the value of attribute linecolor.



118
119
120
# File 'lib/grada/types/gnuplot.rb', line 118

def linecolor
  @linecolor
end

#linestyleObject Also known as: ls

Returns the value of attribute linestyle.



118
119
120
# File 'lib/grada/types/gnuplot.rb', line 118

def linestyle
  @linestyle
end

#linetypeObject Also known as: lt

Returns the value of attribute linetype.



118
119
120
# File 'lib/grada/types/gnuplot.rb', line 118

def linetype
  @linetype
end

#linewidthObject Also known as: lw

Returns the value of attribute linewidth.



118
119
120
# File 'lib/grada/types/gnuplot.rb', line 118

def linewidth
  @linewidth
end

#pointsizeObject Also known as: ps

Returns the value of attribute pointsize.



118
119
120
# File 'lib/grada/types/gnuplot.rb', line 118

def pointsize
  @pointsize
end

#pointtypeObject Also known as: pt

Returns the value of attribute pointtype.



118
119
120
# File 'lib/grada/types/gnuplot.rb', line 118

def pointtype
  @pointtype
end

Class Method Details

.increment_indexObject



138
139
140
141
# File 'lib/grada/types/gnuplot.rb', line 138

def self.increment_index
  @index ||= 0
  @index += 1
end

Instance Method Details

#to_sObject



152
153
154
155
156
157
158
159
160
# File 'lib/grada/types/gnuplot.rb', line 152

def to_s
  str = ' '
  
  STYLES.each do |style|
    str += " #{style} #{send(style)}" if send(style) 
  end
  
  str == ' ' ? '' : str
end