Class: Autotype::TypeVariable
- Inherits:
-
Object
- Object
- Autotype::TypeVariable
- Defined in:
- lib/autotype/engine.rb
Instance Attribute Summary collapse
-
#hint ⇒ Object
readonly
Returns the value of attribute hint.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#scope ⇒ Object
readonly
Returns the value of attribute scope.
Instance Method Summary collapse
- #eql?(other) ⇒ Boolean
- #hash ⇒ Object
-
#initialize(scope, id, hint = nil) ⇒ TypeVariable
constructor
A new instance of TypeVariable.
Constructor Details
#initialize(scope, id, hint = nil) ⇒ TypeVariable
Returns a new instance of TypeVariable.
191 192 193 194 195 |
# File 'lib/autotype/engine.rb', line 191 def initialize(scope, id, hint = nil) @scope = scope @id = id @hint = hint end |
Instance Attribute Details
#hint ⇒ Object (readonly)
Returns the value of attribute hint.
189 190 191 |
# File 'lib/autotype/engine.rb', line 189 def hint @hint end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
189 190 191 |
# File 'lib/autotype/engine.rb', line 189 def id @id end |
#scope ⇒ Object (readonly)
Returns the value of attribute scope.
189 190 191 |
# File 'lib/autotype/engine.rb', line 189 def scope @scope end |
Instance Method Details
#eql?(other) ⇒ Boolean
197 |
# File 'lib/autotype/engine.rb', line 197 def eql?(other) = other.is_a?(TypeVariable) && scope.equal?(other.scope) && id == other.id |
#hash ⇒ Object
198 |
# File 'lib/autotype/engine.rb', line 198 def hash = [scope.object_id, id].hash |