Class: Apiwork::Introspection::Param::Integer
- Defined in:
- lib/apiwork/introspection/param/integer.rb
Overview
Integer param representing whole number values.
Instance Method Summary collapse
-
#boundable? ⇒ Boolean
Whether this param is boundable.
-
#concrete? ⇒ Boolean
Whether this param is concrete.
-
#default ⇒ Object?
The default for this param.
-
#enum ⇒ Array<Integer>, ...
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.
-
#format ⇒ Symbol?
The format for this param.
-
#formattable? ⇒ Boolean
Whether this param is formattable.
-
#integer? ⇒ Boolean
Whether this param is an integer.
-
#max ⇒ Numeric?
The maximum for this param.
-
#min ⇒ Numeric?
The minimum for this param.
-
#numeric? ⇒ Boolean
Whether this param is numeric.
-
#scalar? ⇒ Boolean
Whether this param is scalar.
-
#to_h ⇒ Hash
Converts this param to a hash.
Methods inherited from Base
#array?, #binary?, #boolean?, #date?, #datetime?, #decimal?, #default?, #deprecated?, #description, #initialize, #literal?, #nullable?, #number?, #object?, #optional?, #partial?, #record?, #reference?, #string?, #tag, #time?, #type, #union?, #unknown?, #uuid?
Constructor Details
This class inherits a constructor from Apiwork::Introspection::Param::Base
Instance Method Details
#boundable? ⇒ Boolean
Whether this param is boundable.
123 124 125 |
# File 'lib/apiwork/introspection/param/integer.rb', line 123 def boundable? true end |
#concrete? ⇒ Boolean
Whether this param is concrete.
75 76 77 |
# File 'lib/apiwork/introspection/param/integer.rb', line 75 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.
35 36 37 |
# File 'lib/apiwork/introspection/param/integer.rb', line 35 def default @dump[:default] end |
#enum ⇒ Array<Integer>, ...
The enum for this param.
99 100 101 |
# File 'lib/apiwork/introspection/param/integer.rb', line 99 def enum @dump[:enum] end |
#enum? ⇒ Boolean
Whether this param has an enum.
91 92 93 |
# File 'lib/apiwork/introspection/param/integer.rb', line 91 def enum? @dump[:enum].present? end |
#enum_reference? ⇒ Boolean
Whether this param is an enum reference.
107 108 109 |
# File 'lib/apiwork/introspection/param/integer.rb', line 107 def enum_reference? @dump[:enum].is_a?(Symbol) end |
#example ⇒ Object?
The example for this param.
43 44 45 |
# File 'lib/apiwork/introspection/param/integer.rb', line 43 def example @dump[:example] end |
#format ⇒ Symbol?
The format for this param.
67 68 69 |
# File 'lib/apiwork/introspection/param/integer.rb', line 67 def format @dump[:format] end |
#formattable? ⇒ Boolean
Whether this param is formattable.
131 132 133 |
# File 'lib/apiwork/introspection/param/integer.rb', line 131 def formattable? true end |
#integer? ⇒ Boolean
Whether this param is an integer.
139 140 141 |
# File 'lib/apiwork/introspection/param/integer.rb', line 139 def integer? true end |
#max ⇒ Numeric?
The maximum for this param.
59 60 61 |
# File 'lib/apiwork/introspection/param/integer.rb', line 59 def max @dump[:max] end |
#min ⇒ Numeric?
The minimum for this param.
51 52 53 |
# File 'lib/apiwork/introspection/param/integer.rb', line 51 def min @dump[:min] end |
#numeric? ⇒ Boolean
Whether this param is numeric.
115 116 117 |
# File 'lib/apiwork/introspection/param/integer.rb', line 115 def numeric? true end |
#scalar? ⇒ Boolean
Whether this param is scalar.
83 84 85 |
# File 'lib/apiwork/introspection/param/integer.rb', line 83 def scalar? true end |
#to_h ⇒ Hash
Converts this param to a hash.
147 148 149 150 151 152 153 154 155 156 |
# File 'lib/apiwork/introspection/param/integer.rb', line 147 def to_h result = super result[:default] = default result[:enum] = enum if enum? result[:example] = example result[:format] = format result[:max] = max result[:min] = min result end |