Class: Typical::Type::Hash
- Inherits:
-
List
show all
- Defined in:
- lib/typical/type/list.rb
Instance Attribute Summary
Attributes inherited from List
#storage
Instance Method Summary
collapse
Methods inherited from List
#empty?, #eql?, #hash, #initialize, #values, #values=
#eql?, #hash, #initialize, #nullable?, of, #prominent_type, #types, #|
Instance Method Details
#==(other) ⇒ Object
104
105
106
|
# File 'lib/typical/type/list.rb', line 104
def ==(other)
super && keys == other.keys
end
|
#inspect ⇒ Object
100
101
102
|
# File 'lib/typical/type/list.rb', line 100
def inspect
"#<Type:#{type} { [#{keys.inspect}] => [#{values.inspect}] }>"
end
|
#keys ⇒ Object
92
93
94
|
# File 'lib/typical/type/list.rb', line 92
def keys
@storage[:keys]
end
|
#keys=(keys) ⇒ Object
96
97
98
|
# File 'lib/typical/type/list.rb', line 96
def keys=(keys)
@storage[:keys] = keys
end
|
#normalize ⇒ Object
88
89
90
|
# File 'lib/typical/type/list.rb', line 88
def normalize
super.tap { |copy| copy.keys = keys.normalize(false) }
end
|
#type ⇒ Object
84
85
86
|
# File 'lib/typical/type/list.rb', line 84
def type
::Hash
end
|