Class: Scruby::ControlName
Overview
:nodoc:
Constant Summary collapse
- RATES =
{ 'n_' => :noncontrol, 'i_' => :scalar, 'k_' => :control, 't_' => :trigger }
Instance Attribute Summary collapse
-
#index ⇒ Object
Returns the value of attribute index.
-
#name ⇒ Object
Returns the value of attribute name.
-
#rate ⇒ Object
Returns the value of attribute rate.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(name, value, rate, index) ⇒ ControlName
constructor
A new instance of ControlName.
- #non_control? ⇒ Boolean
- #rate_from_name(name) ⇒ Object
- #set_rate(name, rate) ⇒ Object
Constructor Details
#initialize(name, value, rate, index) ⇒ ControlName
Returns a new instance of ControlName.
6 7 8 |
# File 'lib/scruby/control_name.rb', line 6 def initialize name, value, rate, index @name, @value, @rate, @index = name.to_s, value.to_f, set_rate( name, rate ), index end |
Instance Attribute Details
#index ⇒ Object
Returns the value of attribute index.
3 4 5 |
# File 'lib/scruby/control_name.rb', line 3 def index @index end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/scruby/control_name.rb', line 3 def name @name end |
#rate ⇒ Object
Returns the value of attribute rate.
3 4 5 |
# File 'lib/scruby/control_name.rb', line 3 def rate @rate end |
#value ⇒ Object
Returns the value of attribute value.
3 4 5 |
# File 'lib/scruby/control_name.rb', line 3 def value @value end |
Instance Method Details
#==(other) ⇒ Object
22 23 24 25 26 27 |
# File 'lib/scruby/control_name.rb', line 22 def == other @name == other.name and @value == other.value and @rate == other.rate and @index == other.index end |
#non_control? ⇒ Boolean
18 19 20 |
# File 'lib/scruby/control_name.rb', line 18 def non_control? @rate == :noncontrol end |