Class: Quadtone::Sample

Inherits:
Object
  • Object
show all
Defined in:
lib/quadtone/sample.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#errorObject

Returns the value of attribute error.



7
8
9
# File 'lib/quadtone/sample.rb', line 7

def error
  @error
end

#inputObject

Returns the value of attribute input.



5
6
7
# File 'lib/quadtone/sample.rb', line 5

def input
  @input
end

#labelObject

Returns the value of attribute label.



8
9
10
# File 'lib/quadtone/sample.rb', line 8

def label
  @label
end

#outputObject

Returns the value of attribute output.



6
7
8
# File 'lib/quadtone/sample.rb', line 6

def output
  @output
end

Instance Method Details

#input_valueObject



14
15
16
# File 'lib/quadtone/sample.rb', line 14

def input_value
  @input.value
end

#output_valueObject



18
19
20
# File 'lib/quadtone/sample.rb', line 18

def output_value
  @output.value
end

#to_sObject



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