Class: Musicality::Function::Constant

Inherits:
Musicality::Function show all
Defined in:
lib/musicality/notation/util/function.rb

Instance Attribute Summary collapse

Attributes inherited from Musicality::Function

#domain

Instance Method Summary collapse

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

#valueObject (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