Class: Paramore::Field

Inherits:
Object
  • Object
show all
Defined in:
lib/paramore/field.rb

Constant Summary collapse

DEFAULT_OPTIONS =
{
  null: false,
  compact: false,
  default: nil,
}.freeze

Instance Method Summary collapse

Constructor Details

#initialize(given_type, null:, compact:, default:) ⇒ Field

Returns a new instance of Field.



9
10
11
12
13
14
# File 'lib/paramore/field.rb', line 9

def initialize(given_type, null:, compact:, default:)
  @given_type = given_type
  @nullable = null
  @compact = compact
  @default = default
end

Instance Method Details

#compact?Boolean

Returns:



20
21
22
# File 'lib/paramore/field.rb', line 20

def compact?
  @compact
end

#defaultObject



16
17
18
# File 'lib/paramore/field.rb', line 16

def default
  @default
end

#nullable?Boolean

Returns:



24
25
26
# File 'lib/paramore/field.rb', line 24

def nullable?
  @nullable
end

#typeObject



28
29
30
# File 'lib/paramore/field.rb', line 28

def type
  @given_type
end