Class: Apiwork::Introspection::Param::UUID
- Defined in:
- lib/apiwork/introspection/param/uuid.rb
Overview
UUID param representing universally unique identifier values.
Instance Method Summary collapse
-
#concrete? ⇒ Boolean
Whether this param is concrete.
-
#default ⇒ Object?
The default for this param.
-
#enum ⇒ Array<String>, ...
The enum for this param.
-
#enum? ⇒ Boolean
Whether this param has an enum.
-
#enum_reference? ⇒ Boolean
Whether this param is an enum reference.
-
#example ⇒ Object?
The example for this param.
-
#formattable? ⇒ Boolean
Whether this param is formattable.
-
#scalar? ⇒ Boolean
Whether this param is scalar.
-
#to_h ⇒ Hash
Converts this param to a hash.
-
#uuid? ⇒ Boolean
Whether this param is a UUID.
Methods inherited from Base
#array?, #binary?, #boolean?, #boundable?, #date?, #datetime?, #decimal?, #default?, #deprecated?, #description, #initialize, #integer?, #literal?, #nullable?, #number?, #numeric?, #object?, #optional?, #partial?, #record?, #reference?, #string?, #tag, #time?, #type, #union?, #unknown?
Constructor Details
This class inherits a constructor from Apiwork::Introspection::Param::Base
Instance Method Details
#concrete? ⇒ Boolean
Whether this param is concrete.
46 47 48 |
# File 'lib/apiwork/introspection/param/uuid.rb', line 46 def concrete? true end |
#default ⇒ Object?
The default for this param.
Returns ‘nil` for both “no default” and “default is explicitly `nil`”. Use Base#default? to distinguish these cases.
30 31 32 |
# File 'lib/apiwork/introspection/param/uuid.rb', line 30 def default @dump[:default] end |
#enum ⇒ Array<String>, ...
The enum for this param.
70 71 72 |
# File 'lib/apiwork/introspection/param/uuid.rb', line 70 def enum @dump[:enum] end |
#enum? ⇒ Boolean
Whether this param has an enum.
62 63 64 |
# File 'lib/apiwork/introspection/param/uuid.rb', line 62 def enum? @dump[:enum].present? end |
#enum_reference? ⇒ Boolean
Whether this param is an enum reference.
78 79 80 |
# File 'lib/apiwork/introspection/param/uuid.rb', line 78 def enum_reference? @dump[:enum].is_a?(Symbol) end |
#example ⇒ Object?
The example for this param.
38 39 40 |
# File 'lib/apiwork/introspection/param/uuid.rb', line 38 def example @dump[:example] end |
#formattable? ⇒ Boolean
Whether this param is formattable.
94 95 96 |
# File 'lib/apiwork/introspection/param/uuid.rb', line 94 def formattable? false end |
#scalar? ⇒ Boolean
Whether this param is scalar.
54 55 56 |
# File 'lib/apiwork/introspection/param/uuid.rb', line 54 def scalar? true end |
#to_h ⇒ Hash
Converts this param to a hash.
102 103 104 105 106 107 108 |
# File 'lib/apiwork/introspection/param/uuid.rb', line 102 def to_h result = super result[:default] = default result[:enum] = enum if enum? result[:example] = example result end |
#uuid? ⇒ Boolean
Whether this param is a UUID.
86 87 88 |
# File 'lib/apiwork/introspection/param/uuid.rb', line 86 def uuid? true end |