Class: T::Types::TypedHash
- Inherits:
-
TypedEnumerable
- Object
- Base
- TypedEnumerable
- T::Types::TypedHash
- Defined in:
- lib/types/types/typed_hash.rb
Instance Attribute Summary collapse
-
#keys ⇒ Object
readonly
Technically we don’t need these, but they are a nice api.
-
#values ⇒ Object
readonly
Technically we don’t need these, but they are a nice api.
Attributes inherited from TypedEnumerable
Instance Method Summary collapse
-
#initialize(keys:, values:) ⇒ TypedHash
constructor
A new instance of TypedHash.
- #name ⇒ Object
-
#new(*args, &blk) ⇒ Object
rubocop:disable PrisonGuard/BanBuiltinMethodOverride.
- #valid?(obj) ⇒ Boolean
Methods inherited from TypedEnumerable
Methods inherited from Base
#==, #describe_obj, #error_message_for_obj, #hash, method_added, #subtype_of?, #to_s, #validate!
Constructor Details
Instance Attribute Details
#keys ⇒ Object (readonly)
Technically we don’t need these, but they are a nice api
7 8 9 |
# File 'lib/types/types/typed_hash.rb', line 7 def keys @keys end |
#values ⇒ Object (readonly)
Technically we don’t need these, but they are a nice api
7 8 9 |
# File 'lib/types/types/typed_hash.rb', line 7 def values @values end |
Instance Method Details
#name ⇒ Object
16 17 18 |
# File 'lib/types/types/typed_hash.rb', line 16 def name "T::Hash[#{@keys.name}, #{@values.name}]" end |