Class: Sol::OrdinalScale
Overview
Instance Attribute Summary
Attributes inherited from Scale
Instance Method Summary collapse
-
#domain(values) ⇒ Object
————————————————————————————.
Methods inherited from Scale
Constructor Details
This class inherits a constructor from Sol::Scale
Instance Method Details
#domain(values) ⇒ Object
194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 |
# File 'lib/sol/scale.rb', line 194 def domain(values) # If the array has more than two elements then 'range' needs to have the same number # of elements @elements = values.size scale = "[" values.each_with_index do |value, i| scale << ", " if i > 0 scale << "#{value}" end scale << "]" @spec << ".domain(#{scale})" end |