Class: Musicality::Function::Constant
- Inherits:
-
Musicality::Function
- Object
- Musicality::Function
- Musicality::Function::Constant
- Defined in:
- lib/musicality/notation/util/function.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Attributes inherited from Musicality::Function
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(value) ⇒ Constant
constructor
A new instance of Constant.
Methods inherited from Musicality::Function
#at, #sample, transform_domains
Constructor Details
#initialize(value) ⇒ Constant
Returns a new instance of Constant.
48 49 50 51 |
# File 'lib/musicality/notation/util/function.rb', line 48 def initialize value @value = value super() {|x| @value } end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
46 47 48 |
# File 'lib/musicality/notation/util/function.rb', line 46 def value @value end |
Instance Method Details
#==(other) ⇒ Object
53 54 55 |
# File 'lib/musicality/notation/util/function.rb', line 53 def ==(other) super(other) && @value == other.value end |