class Parlour::Types::Hash
A hash with known key and value types.
Attributes
key[R]
value[R]
Public Class Methods
new(key, value)
click to toggle source
# File lib/parlour/types.rb, line 336 def initialize(key, value) @key = to_type(key) @value = to_type(value) end
Public Instance Methods
==(other)
click to toggle source
# File lib/parlour/types.rb, line 342 def ==(other) Hash === other && key == other.key && value == other.value end
describe()
click to toggle source
# File lib/parlour/types.rb, line 363 def describe "Hash<#{key.describe}, #{value.describe}>" end
generate_rbi()
click to toggle source
# File lib/parlour/types.rb, line 353 def generate_rbi "T::Hash[#{key.generate_rbi}, #{value.generate_rbi}]" end
generate_rbs()
click to toggle source
# File lib/parlour/types.rb, line 358 def generate_rbs "::Hash[#{key.generate_rbs}, #{value.generate_rbs}]" end