Class: NRSER::Types::HashType
Overview
A type who’s members simply are Hash instances.
Implements Type#from_s to provide JSON/YAML detection, as well as “simple” loading aimed at CLI option values.
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from IsA
Instance Method Summary collapse
- #default_symbolic ⇒ Object
-
#initialize(**options) ⇒ HashType
constructor
Instantiate a new ‘HashType`.
-
#keys ⇒ NRSER::Types::Type
In order to provide the same interface as HashOfType, this method always returns any.
-
#values ⇒ NRSER::Types::Type
In order to provide the same interface as HashOfType, this method always returns any.
Methods inherited from IsA
#==, #custom_from_data, #explain, #has_from_data?, #init_from_data?, #test?
Methods inherited from Type
#===, #builtin_inspect, #check, #check!, #default_name, #explain, #from_data, #from_s, #has_from_data?, #has_from_s?, #has_to_data?, #inspect, #intersection, #name, #not, #respond_to?, #symbolic, #test, #test?, #to_data, #to_proc, #to_s, #union, #xor
Constructor Details
Instance Method Details
#default_symbolic ⇒ Object
61 62 63 |
# File 'lib/nrser/types/hashes.rb', line 61 def default_symbolic "{#{ keys.symbolic }#{ ASSOC }#{ values.symbolic }}" end |
#keys ⇒ NRSER::Types::Type
In order to provide the same interface as NRSER::Types::HashOfType, this method always returns NRSER::Types.any.
50 |
# File 'lib/nrser/types/hashes.rb', line 50 def keys; NRSER::Types.Top; end |
#values ⇒ NRSER::Types::Type
In order to provide the same interface as NRSER::Types::HashOfType, this method always returns NRSER::Types.any.
58 |
# File 'lib/nrser/types/hashes.rb', line 58 def values; NRSER::Types.Top; end |