Class: Apiwork::Introspection::Param::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/apiwork/introspection/param/base.rb

Instance Method Summary collapse

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.

Returns:



90
91
92
# File 'lib/apiwork/introspection/param/base.rb', line 90

def array?
  false
end

#binary?Boolean

Whether this param is binary data.

Returns:



218
219
220
# File 'lib/apiwork/introspection/param/base.rb', line 218

def binary?
  false
end

#boolean?Boolean

Whether this param is a boolean.

Returns:



178
179
180
# File 'lib/apiwork/introspection/param/base.rb', line 178

def boolean?
  false
end

#boundable?Boolean

Whether this param is boundable.

Returns:



138
139
140
# File 'lib/apiwork/introspection/param/base.rb', line 138

def boundable?
  false
end

#concrete?Boolean

Whether this param is concrete.

Returns:



74
75
76
# File 'lib/apiwork/introspection/param/base.rb', line 74

def concrete?
  false
end

#date?Boolean

Whether this param is a date.

Returns:



194
195
196
# File 'lib/apiwork/introspection/param/base.rb', line 194

def date?
  false
end

#datetime?Boolean

Whether this param is a datetime.

Returns:



186
187
188
# File 'lib/apiwork/introspection/param/base.rb', line 186

def datetime?
  false
end

#decimal?Boolean

Whether this param is a decimal.

Returns:



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.

Returns:



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.

Returns:



39
40
41
# File 'lib/apiwork/introspection/param/base.rb', line 39

def deprecated?
  @dump[:deprecated]
end

#descriptionString?

The description for this param.

Returns:



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.

Returns:



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.

Returns:



250
251
252
# File 'lib/apiwork/introspection/param/base.rb', line 250

def enum_reference?
  false
end

#formattable?Boolean

Whether this param is formattable.

Returns:



258
259
260
# File 'lib/apiwork/introspection/param/base.rb', line 258

def formattable?
  false
end

#integer?Boolean

Whether this param is an integer.

Returns:



154
155
156
# File 'lib/apiwork/introspection/param/base.rb', line 154

def integer?
  false
end

#literal?Boolean

Whether this param is a literal.

Returns:



122
123
124
# File 'lib/apiwork/introspection/param/base.rb', line 122

def literal?
  false
end

#nullable?Boolean

Whether this param is nullable.

Returns:



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.

Returns:



162
163
164
# File 'lib/apiwork/introspection/param/base.rb', line 162

def number?
  false
end

#numeric?Boolean

Whether this param is numeric.

Returns:



130
131
132
# File 'lib/apiwork/introspection/param/base.rb', line 130

def numeric?
  false
end

#object?Boolean

Whether this param is an object.

Returns:



98
99
100
# File 'lib/apiwork/introspection/param/base.rb', line 98

def object?
  false
end

#optional?Boolean

Whether this param is optional.

Returns:



31
32
33
# File 'lib/apiwork/introspection/param/base.rb', line 31

def optional?
  @dump[:optional]
end

#partial?Boolean

Whether this param is partial.

Returns:



266
267
268
# File 'lib/apiwork/introspection/param/base.rb', line 266

def partial?
  false
end

#record?Boolean

Whether this param is a record.

Returns:



106
107
108
# File 'lib/apiwork/introspection/param/base.rb', line 106

def record?
  false
end

#reference?Boolean

Whether this param is a reference.

Returns:



234
235
236
# File 'lib/apiwork/introspection/param/base.rb', line 234

def reference?
  false
end

#scalar?Boolean

Whether this param is scalar.

Returns:



82
83
84
# File 'lib/apiwork/introspection/param/base.rb', line 82

def scalar?
  false
end

#string?Boolean

Whether this param is a string.

Returns:



146
147
148
# File 'lib/apiwork/introspection/param/base.rb', line 146

def string?
  false
end

#tagString?

The tag for this param.

Returns:



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.

Returns:



202
203
204
# File 'lib/apiwork/introspection/param/base.rb', line 202

def time?
  false
end

#to_hHash

Converts this param to a hash.

Returns:

  • (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

#typeSymbol

The type for this param.

Returns:

  • (Symbol)


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.

Returns:



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.

Returns:



226
227
228
# File 'lib/apiwork/introspection/param/base.rb', line 226

def unknown?
  false
end

#uuid?Boolean

Whether this param is a UUID.

Returns:



210
211
212
# File 'lib/apiwork/introspection/param/base.rb', line 210

def uuid?
  false
end