Class: Doorkeeper::OAuth::Error

Inherits:
Struct
  • Object
show all
Defined in:
lib/doorkeeper/oauth/error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



5
6
7
# File 'lib/doorkeeper/oauth/error.rb', line 5

def name
  @name
end

#stateObject

Returns the value of attribute state

Returns:

  • (Object)

    the current value of state



5
6
7
# File 'lib/doorkeeper/oauth/error.rb', line 5

def state
  @state
end

#translate_optionsObject

Returns the value of attribute translate_options

Returns:

  • (Object)

    the current value of translate_options



5
6
7
# File 'lib/doorkeeper/oauth/error.rb', line 5

def translate_options
  @translate_options
end

Instance Method Details

#descriptionObject



6
7
8
9
10
11
12
13
# File 'lib/doorkeeper/oauth/error.rb', line 6

def description
  options = (translate_options || {}).merge(
    scope: %i[doorkeeper errors messages],
    default: :server_error,
  )

  I18n.translate(name, **options)
end