Class: Apiwork::Introspection::Enum
- Inherits:
-
Object
- Object
- Apiwork::Introspection::Enum
- Defined in:
- lib/apiwork/introspection/enum.rb
Overview
Wraps enum type definitions.
Instance Method Summary collapse
-
#deprecated? ⇒ Boolean
Whether this enum is deprecated.
-
#description ⇒ String?
The description for this enum.
-
#example ⇒ String?
The example for this enum.
-
#initialize(dump) ⇒ Enum
constructor
A new instance of Enum.
-
#scope ⇒ String?
The scope for this enum.
-
#to_h ⇒ Hash
Converts this enum to a hash.
-
#values ⇒ Array<String>
The values for this enum.
Constructor Details
#initialize(dump) ⇒ Enum
Returns a new instance of Enum.
13 14 15 |
# File 'lib/apiwork/introspection/enum.rb', line 13 def initialize(dump) @dump = dump end |
Instance Method Details
#deprecated? ⇒ Boolean
Whether this enum is deprecated.
53 54 55 |
# File 'lib/apiwork/introspection/enum.rb', line 53 def deprecated? @dump[:deprecated] end |
#description ⇒ String?
The description for this enum.
29 30 31 |
# File 'lib/apiwork/introspection/enum.rb', line 29 def description @dump[:description] end |
#example ⇒ String?
The example for this enum.
37 38 39 |
# File 'lib/apiwork/introspection/enum.rb', line 37 def example @dump[:example] end |
#scope ⇒ String?
The scope for this enum.
45 46 47 |
# File 'lib/apiwork/introspection/enum.rb', line 45 def scope @dump[:scope] end |
#to_h ⇒ Hash
Converts this enum to a hash.
61 62 63 64 65 66 67 68 69 |
# File 'lib/apiwork/introspection/enum.rb', line 61 def to_h { deprecated: deprecated?, description: description, example: example, scope: scope, values: values, } end |
#values ⇒ Array<String>
The values for this enum.
21 22 23 |
# File 'lib/apiwork/introspection/enum.rb', line 21 def values @dump[:values] end |