Class: JsonapiErrorsHandler::Configuration

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/jsonapi_errors_handler/configuration.rb

Overview

Configuration class allowing to set up the initial behavior for the gem

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#content_typeObject

Returns the value of attribute content_type.



12
13
14
# File 'lib/jsonapi_errors_handler/configuration.rb', line 12

def content_type
  @content_type
end

#handle_unexpected=(value) ⇒ Object (writeonly)

Sets the attribute handle_unexpected

Parameters:

  • value

    the value to set the attribute handle_unexpected to.



11
12
13
# File 'lib/jsonapi_errors_handler/configuration.rb', line 11

def handle_unexpected=(value)
  @handle_unexpected = value
end

Instance Method Details

#configure {|_self| ... } ⇒ Object

Allows to override the configuration options

Parameters:

  • - (Block)

    list of options to be overwritten

Yields:

  • (_self)

Yield Parameters:



16
17
18
# File 'lib/jsonapi_errors_handler/configuration.rb', line 16

def configure
  yield(self) if block_given?
end

#handle_unexpected?Boolean

Checks if unexpected errors should be handled by the gem

Returns:

  • (Boolean)


23
24
25
# File 'lib/jsonapi_errors_handler/configuration.rb', line 23

def handle_unexpected?
  @handle_unexpected
end