Module: FastJsonapi

Defined in:
lib/fast_jsonapi.rb,
lib/fast_jsonapi/link.rb,
lib/fast_jsonapi/scalar.rb,
lib/fast_jsonapi/helpers.rb,
lib/fast_jsonapi/version.rb,
lib/fast_jsonapi/attribute.rb,
lib/fast_jsonapi/relationship.rb,
lib/fast_jsonapi/object_serializer.rb,
lib/fast_jsonapi/serialization_core.rb,
lib/fast_jsonapi/instrumentation/serialized_json.rb,
lib/fast_jsonapi/instrumentation/serializable_hash.rb,
lib/fast_jsonapi/instrumentation/skylight/normalizers/serialized_json.rb,
lib/fast_jsonapi/instrumentation/skylight/normalizers/serializable_hash.rb

Defined Under Namespace

Modules: Instrumentation, ObjectSerializer, SerializationCore Classes: Attribute, Link, Relationship, Scalar

Constant Summary collapse

VERSION =
JSONAPI::Serializer::VERSION
MandatoryField =
Class.new(StandardError)

Class Method Summary collapse

Class Method Details

.call_proc(proc, *params) ⇒ Object

Calls either a Proc or a Lambda, making sure to never pass more parameters to it than it can receive

Parameters:

  • proc (Proc)

    the Proc or Lambda to call

  • *params (Array<Object>)

    any number of parameters to be passed to the Proc

Returns:

  • (Object)

    the result of the Proc call with the supplied parameters



8
9
10
# File 'lib/fast_jsonapi/helpers.rb', line 8

def call_proc(proc, *params)
  proc.call(*params.take(proc.parameters.length))
end