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
105
106
107
|
# File 'lib/typical/type/list.rb', line 105
def ==(other)
super && keys == other.keys
end
|
#inspect ⇒ Object
101
102
103
|
# File 'lib/typical/type/list.rb', line 101
def inspect
"#<Type:#{type} { [#{keys.inspect}] => [#{values.inspect}] }>"
end
|
#keys ⇒ Object
93
94
95
|
# File 'lib/typical/type/list.rb', line 93
def keys
@storage[:keys]
end
|
#keys=(keys) ⇒ Object
97
98
99
|
# File 'lib/typical/type/list.rb', line 97
def keys=(keys)
@storage[:keys] = keys
end
|
#normalize ⇒ Object
89
90
91
|
# File 'lib/typical/type/list.rb', line 89
def normalize
super.tap { |copy| copy.keys = keys.normalize(false) }
end
|
#type ⇒ Object
85
86
87
|
# File 'lib/typical/type/list.rb', line 85
def type
::Hash
end
|