Module: Grape::Util::Registrable

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

Instance Method Summary collapse

Instance Method Details

#default_elementsObject


6
7
8
# File 'lib/grape/util/registrable.rb', line 6

def default_elements
  @default_elements ||= {}
end

#register(format, element) ⇒ Object


10
11
12
# File 'lib/grape/util/registrable.rb', line 10

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