Class: Style
- Inherits:
-
Object
- Object
- Style
- Defined in:
- lib/grada/gnuplot.rb
Constant Summary collapse
- STYLES =
[:ls, :lt, :lw, :lc, :pt, :ps, :fs]
Instance Attribute Summary collapse
-
#fill ⇒ Object
(also: #fs)
Returns the value of attribute fill.
-
#index ⇒ Object
Returns the value of attribute index.
-
#linecolor ⇒ Object
(also: #lc)
Returns the value of attribute linecolor.
-
#linestyle ⇒ Object
(also: #ls)
Returns the value of attribute linestyle.
-
#linetype ⇒ Object
(also: #lt)
Returns the value of attribute linetype.
-
#linewidth ⇒ Object
(also: #lw)
Returns the value of attribute linewidth.
-
#pointsize ⇒ Object
(also: #ps)
Returns the value of attribute pointsize.
-
#pointtype ⇒ Object
(also: #pt)
Returns the value of attribute pointtype.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize {|_self| ... } ⇒ Style
constructor
A new instance of Style.
- #to_s ⇒ Object
Constructor Details
#initialize {|_self| ... } ⇒ Style
Returns a new instance of Style.
137 138 139 140 141 142 143 144 |
# File 'lib/grada/gnuplot.rb', line 137 def initialize STYLES.each do |style| send("#{style}=", nil) end yield self if block_given? end |
Instance Attribute Details
#fill ⇒ Object Also known as: fs
Returns the value of attribute fill.
112 113 114 |
# File 'lib/grada/gnuplot.rb', line 112 def fill @fill end |
#index ⇒ Object
Returns the value of attribute index.
112 113 114 |
# File 'lib/grada/gnuplot.rb', line 112 def index @index end |
#linecolor ⇒ Object Also known as: lc
Returns the value of attribute linecolor.
112 113 114 |
# File 'lib/grada/gnuplot.rb', line 112 def linecolor @linecolor end |
#linestyle ⇒ Object Also known as: ls
Returns the value of attribute linestyle.
112 113 114 |
# File 'lib/grada/gnuplot.rb', line 112 def linestyle @linestyle end |
#linetype ⇒ Object Also known as: lt
Returns the value of attribute linetype.
112 113 114 |
# File 'lib/grada/gnuplot.rb', line 112 def linetype @linetype end |
#linewidth ⇒ Object Also known as: lw
Returns the value of attribute linewidth.
112 113 114 |
# File 'lib/grada/gnuplot.rb', line 112 def linewidth @linewidth end |
#pointsize ⇒ Object Also known as: ps
Returns the value of attribute pointsize.
112 113 114 |
# File 'lib/grada/gnuplot.rb', line 112 def pointsize @pointsize end |
#pointtype ⇒ Object Also known as: pt
Returns the value of attribute pointtype.
112 113 114 |
# File 'lib/grada/gnuplot.rb', line 112 def pointtype @pointtype end |
Class Method Details
.increment_index ⇒ Object
132 133 134 135 |
# File 'lib/grada/gnuplot.rb', line 132 def self.increment_index @index ||= 0 @index += 1 end |
Instance Method Details
#to_s ⇒ Object
146 147 148 149 150 151 152 153 154 |
# File 'lib/grada/gnuplot.rb', line 146 def to_s str = ' ' STYLES.each do |style| str += " #{style} #{send(style)}" if send(style) end str == ' ' ? '' : str end |