Module: Grape::Util::Registrable

Included in:
ErrorFormatter, Formatter, Parser
Defined in:
lib/grape/util/registrable.rb

Instance Method Summary collapse

Instance Method Details

#default_elementsObject


4
5
6
# File 'lib/grape/util/registrable.rb', line 4

def default_elements
  @default_elements ||= {}
end

#register(format, element) ⇒ Object


8
9
10
# File 'lib/grape/util/registrable.rb', line 8

def register(format, element)
  default_elements[format] = element unless default_elements[format]
end