Class: GqlSerializer::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/gql_serializer/configuration.rb

Constant Summary collapse

CAMEL_CASE =
:camel
SNAKE_CASE =
:snake
NONE_CASE =
:none
SUPPORTED_CASES =
[CAMEL_CASE, SNAKE_CASE, NONE_CASE]

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



10
11
12
# File 'lib/gql_serializer/configuration.rb', line 10

def initialize
  reset
end

Instance Attribute Details

#caseObject

Returns the value of attribute case.



14
15
16
# File 'lib/gql_serializer/configuration.rb', line 14

def case
  @case
end

#preloadObject

Returns the value of attribute preload.



14
15
16
# File 'lib/gql_serializer/configuration.rb', line 14

def preload
  @preload
end

Instance Method Details

#resetObject



21
22
23
24
# File 'lib/gql_serializer/configuration.rb', line 21

def reset
  @case = NONE_CASE
  @preload = false # Default will be true in version 3+
end

#to_hObject



26
27
28
# File 'lib/gql_serializer/configuration.rb', line 26

def to_h
  self.instance_values.symbolize_keys
end