Class: Quadtone::Sample
- Inherits:
-
Object
- Object
- Quadtone::Sample
- Defined in:
- lib/quadtone/sample.rb
Instance Attribute Summary collapse
-
#error ⇒ Object
Returns the value of attribute error.
-
#input ⇒ Object
Returns the value of attribute input.
-
#label ⇒ Object
Returns the value of attribute label.
-
#output ⇒ Object
Returns the value of attribute output.
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ Sample
constructor
A new instance of Sample.
- #input_value ⇒ Object
- #output_value ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(params = {}) ⇒ Sample
Returns a new instance of Sample.
10 11 12 |
# File 'lib/quadtone/sample.rb', line 10 def initialize(params={}) params.each { |key, value| send("#{key}=", value) } end |
Instance Attribute Details
#error ⇒ Object
Returns the value of attribute error.
7 8 9 |
# File 'lib/quadtone/sample.rb', line 7 def error @error end |
#input ⇒ Object
Returns the value of attribute input.
5 6 7 |
# File 'lib/quadtone/sample.rb', line 5 def input @input end |
#label ⇒ Object
Returns the value of attribute label.
8 9 10 |
# File 'lib/quadtone/sample.rb', line 8 def label @label end |
#output ⇒ Object
Returns the value of attribute output.
6 7 8 |
# File 'lib/quadtone/sample.rb', line 6 def output @output end |
Instance Method Details
#input_value ⇒ Object
14 15 16 |
# File 'lib/quadtone/sample.rb', line 14 def input_value @input.value end |
#output_value ⇒ Object
18 19 20 |
# File 'lib/quadtone/sample.rb', line 18 def output_value @output.value end |
#to_s ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/quadtone/sample.rb', line 22 def to_s "%s / %s%s" % [ input, output, label ? " [#{label}]" : '', ] end |