Class: Apiwork::Introspection::Param::Base
- Inherits:
-
Object
- Object
- Apiwork::Introspection::Param::Base
- Defined in:
- lib/apiwork/introspection/param/base.rb
Direct Known Subclasses
Array, Binary, Boolean, Date, DateTime, Decimal, Integer, Literal, Number, Object, Record, Reference, String, Time, UUID, Union, Unknown
Instance Method Summary collapse
-
#array? ⇒ Boolean
Whether this param is an array.
-
#binary? ⇒ Boolean
Whether this param is binary data.
-
#boolean? ⇒ Boolean
Whether this param is a boolean.
-
#boundable? ⇒ Boolean
Whether this param is boundable.
-
#concrete? ⇒ Boolean
Whether this param is concrete.
-
#date? ⇒ Boolean
Whether this param is a date.
-
#datetime? ⇒ Boolean
Whether this param is a datetime.
-
#decimal? ⇒ Boolean
Whether this param is a decimal.
-
#default? ⇒ Boolean
Whether this param has a default value.
-
#deprecated? ⇒ Boolean
Whether this param is deprecated.
-
#description ⇒ String?
The description for this param.
-
#enum? ⇒ Boolean
Whether this param has an enum.
-
#enum_reference? ⇒ Boolean
Whether this param is an enum reference.
-
#formattable? ⇒ Boolean
Whether this param is formattable.
-
#initialize(dump) ⇒ Base
constructor
A new instance of Base.
-
#integer? ⇒ Boolean
Whether this param is an integer.
-
#literal? ⇒ Boolean
Whether this param is a literal.
-
#nullable? ⇒ Boolean
Whether this param is nullable.
-
#number? ⇒ Boolean
Whether this param is a number.
-
#numeric? ⇒ Boolean
Whether this param is numeric.
-
#object? ⇒ Boolean
Whether this param is an object.
-
#optional? ⇒ Boolean
Whether this param is optional.
-
#partial? ⇒ Boolean
Whether this param is partial.
-
#record? ⇒ Boolean
Whether this param is a record.
-
#reference? ⇒ Boolean
Whether this param is a reference.
-
#scalar? ⇒ Boolean
Whether this param is scalar.
-
#string? ⇒ Boolean
Whether this param is a string.
-
#tag ⇒ String?
The tag for this param.
-
#time? ⇒ Boolean
Whether this param is a time.
-
#to_h ⇒ Hash
Converts this param to a hash.
-
#type ⇒ Symbol
The type for this param.
-
#union? ⇒ Boolean
Whether this param is a union.
-
#unknown? ⇒ Boolean
Whether this param is of unknown type.
-
#uuid? ⇒ Boolean
Whether this param is a UUID.
Constructor Details
#initialize(dump) ⇒ Base
Returns a new instance of Base.
7 8 9 |
# File 'lib/apiwork/introspection/param/base.rb', line 7 def initialize(dump) @dump = dump end |
Instance Method Details
#array? ⇒ Boolean
Whether this param is an array.
90 91 92 |
# File 'lib/apiwork/introspection/param/base.rb', line 90 def array? false end |
#binary? ⇒ Boolean
Whether this param is binary data.
218 219 220 |
# File 'lib/apiwork/introspection/param/base.rb', line 218 def binary? false end |
#boolean? ⇒ Boolean
Whether this param is a boolean.
178 179 180 |
# File 'lib/apiwork/introspection/param/base.rb', line 178 def boolean? false end |
#boundable? ⇒ Boolean
Whether this param is boundable.
138 139 140 |
# File 'lib/apiwork/introspection/param/base.rb', line 138 def boundable? false end |
#concrete? ⇒ Boolean
Whether this param is concrete.
74 75 76 |
# File 'lib/apiwork/introspection/param/base.rb', line 74 def concrete? false end |
#date? ⇒ Boolean
Whether this param is a date.
194 195 196 |
# File 'lib/apiwork/introspection/param/base.rb', line 194 def date? false end |
#datetime? ⇒ Boolean
Whether this param is a datetime.
186 187 188 |
# File 'lib/apiwork/introspection/param/base.rb', line 186 def datetime? false end |
#decimal? ⇒ Boolean
Whether this param is a decimal.
170 171 172 |
# File 'lib/apiwork/introspection/param/base.rb', line 170 def decimal? false end |
#default? ⇒ Boolean
Whether this param has a default value.
Use this to distinguish “no default” from “default is explicitly ‘nil`”. The #default accessor returns `nil` in both cases.
58 59 60 |
# File 'lib/apiwork/introspection/param/base.rb', line 58 def default? @dump.key?(:default) end |
#deprecated? ⇒ Boolean
Whether this param is deprecated.
39 40 41 |
# File 'lib/apiwork/introspection/param/base.rb', line 39 def deprecated? @dump[:deprecated] end |
#description ⇒ String?
The description for this param.
47 48 49 |
# File 'lib/apiwork/introspection/param/base.rb', line 47 def description @dump[:description] end |
#enum? ⇒ Boolean
Whether this param has an enum.
242 243 244 |
# File 'lib/apiwork/introspection/param/base.rb', line 242 def enum? false end |
#enum_reference? ⇒ Boolean
Whether this param is an enum reference.
250 251 252 |
# File 'lib/apiwork/introspection/param/base.rb', line 250 def enum_reference? false end |
#formattable? ⇒ Boolean
Whether this param is formattable.
258 259 260 |
# File 'lib/apiwork/introspection/param/base.rb', line 258 def formattable? false end |
#integer? ⇒ Boolean
Whether this param is an integer.
154 155 156 |
# File 'lib/apiwork/introspection/param/base.rb', line 154 def integer? false end |
#literal? ⇒ Boolean
Whether this param is a literal.
122 123 124 |
# File 'lib/apiwork/introspection/param/base.rb', line 122 def literal? false end |
#nullable? ⇒ Boolean
Whether this param is nullable.
23 24 25 |
# File 'lib/apiwork/introspection/param/base.rb', line 23 def nullable? @dump[:nullable] end |
#number? ⇒ Boolean
Whether this param is a number.
162 163 164 |
# File 'lib/apiwork/introspection/param/base.rb', line 162 def number? false end |
#numeric? ⇒ Boolean
Whether this param is numeric.
130 131 132 |
# File 'lib/apiwork/introspection/param/base.rb', line 130 def numeric? false end |
#object? ⇒ Boolean
Whether this param is an object.
98 99 100 |
# File 'lib/apiwork/introspection/param/base.rb', line 98 def object? false end |
#optional? ⇒ Boolean
Whether this param is optional.
31 32 33 |
# File 'lib/apiwork/introspection/param/base.rb', line 31 def optional? @dump[:optional] end |
#partial? ⇒ Boolean
Whether this param is partial.
266 267 268 |
# File 'lib/apiwork/introspection/param/base.rb', line 266 def partial? false end |
#record? ⇒ Boolean
Whether this param is a record.
106 107 108 |
# File 'lib/apiwork/introspection/param/base.rb', line 106 def record? false end |
#reference? ⇒ Boolean
Whether this param is a reference.
234 235 236 |
# File 'lib/apiwork/introspection/param/base.rb', line 234 def reference? false end |
#scalar? ⇒ Boolean
Whether this param is scalar.
82 83 84 |
# File 'lib/apiwork/introspection/param/base.rb', line 82 def scalar? false end |
#string? ⇒ Boolean
Whether this param is a string.
146 147 148 |
# File 'lib/apiwork/introspection/param/base.rb', line 146 def string? false end |
#tag ⇒ String?
The tag for this param.
66 67 68 |
# File 'lib/apiwork/introspection/param/base.rb', line 66 def tag @dump[:tag] end |
#time? ⇒ Boolean
Whether this param is a time.
202 203 204 |
# File 'lib/apiwork/introspection/param/base.rb', line 202 def time? false end |
#to_h ⇒ Hash
Converts this param to a hash.
274 275 276 277 278 279 280 281 282 |
# File 'lib/apiwork/introspection/param/base.rb', line 274 def to_h { deprecated: deprecated?, description: description, nullable: nullable?, optional: optional?, type: type, } end |
#type ⇒ Symbol
The type for this param.
15 16 17 |
# File 'lib/apiwork/introspection/param/base.rb', line 15 def type @dump[:type] end |
#union? ⇒ Boolean
Whether this param is a union.
114 115 116 |
# File 'lib/apiwork/introspection/param/base.rb', line 114 def union? false end |
#unknown? ⇒ Boolean
Whether this param is of unknown type.
226 227 228 |
# File 'lib/apiwork/introspection/param/base.rb', line 226 def unknown? false end |
#uuid? ⇒ Boolean
Whether this param is a UUID.
210 211 212 |
# File 'lib/apiwork/introspection/param/base.rb', line 210 def uuid? false end |