Class: Apiwork::Introspection::Param::Reference

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

Overview

Reference param representing a reference to a named type.

Examples:

Basic usage

param.type # => :reference
param.reference? # => true
param.scalar? # => false

Reference

param.reference # => :address

Instance Method Summary collapse

Methods inherited from Base

#array?, #binary?, #boolean?, #boundable?, #concrete?, #date?, #datetime?, #decimal?, #default?, #deprecated?, #description, #enum?, #enum_reference?, #formattable?, #initialize, #integer?, #literal?, #nullable?, #number?, #numeric?, #object?, #optional?, #partial?, #record?, #scalar?, #string?, #tag, #time?, #type, #union?, #unknown?, #uuid?

Constructor Details

This class inherits a constructor from Apiwork::Introspection::Param::Base

Instance Method Details

#referenceSymbol

The reference for this param.

Returns:

  • (Symbol)


21
22
23
# File 'lib/apiwork/introspection/param/reference.rb', line 21

def reference
  @dump[:reference]
end

#reference?Boolean

Whether this param is a reference.

Returns:



29
30
31
# File 'lib/apiwork/introspection/param/reference.rb', line 29

def reference?
  true
end

#to_hHash

Converts this param to a hash.

Returns:

  • (Hash)


37
38
39
40
41
# File 'lib/apiwork/introspection/param/reference.rb', line 37

def to_h
  result = super
  result[:reference] = reference
  result
end