Module: Shamu::JsonApi::BuilderMethods::Meta

Included in:
Shamu::JsonApi::BaseBuilder, ErrorBuilder
Defined in:
lib/shamu/json_api/builder_methods/meta.rb

Instance Method Summary collapse

Instance Method Details

#meta(name, value) ⇒ self

Add a meta field.

Parameters:

  • name (String, Symbol)

    of the meta field.

  • vlaue (Object)

    that can be converted to a JSON primitive type.

Returns:

  • (self)


9
10
11
12
13
14
# File 'lib/shamu/json_api/builder_methods/meta.rb', line 9

def meta( name, value )
  meta = ( output[:meta] ||= {} )
  meta[ name.to_sym ] = value

  self
end