Class: Steep::TypeName::Base
- Inherits:
-
Object
- Object
- Steep::TypeName::Base
show all
- Defined in:
- lib/steep/type_name.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(name:) ⇒ Base
6
7
8
|
# File 'lib/steep/type_name.rb', line 6
def initialize(name:)
@name = name
end
|
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
4
5
6
|
# File 'lib/steep/type_name.rb', line 4
def name
@name
end
|
Instance Method Details
#==(other) ⇒ Object
Also known as:
eql?
10
11
12
|
# File 'lib/steep/type_name.rb', line 10
def ==(other)
other.is_a?(self.class) && other.name == name
end
|
#hash ⇒ Object
14
15
16
|
# File 'lib/steep/type_name.rb', line 14
def hash
self.class.hash ^ name.hash
end
|
#map_module_name ⇒ Object
24
25
26
|
# File 'lib/steep/type_name.rb', line 24
def map_module_name
self.class.new(name: yield(name))
end
|
#to_s ⇒ Object
20
21
22
|
# File 'lib/steep/type_name.rb', line 20
def to_s
name.to_s
end
|