Class: JSONAPI::CachedResponseFragment::Lookup

Inherits:
Struct
  • Object
show all
Defined in:
lib/jsonapi/cached_response_fragment.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#cache_idsObject

Returns the value of attribute cache_ids

Returns:

  • (Object)

    the current value of cache_ids



4
5
6
# File 'lib/jsonapi/cached_response_fragment.rb', line 4

def cache_ids
  @cache_ids
end

#contextObject

Returns the value of attribute context

Returns:

  • (Object)

    the current value of context



4
5
6
# File 'lib/jsonapi/cached_response_fragment.rb', line 4

def context
  @context
end

#context_keyObject

Returns the value of attribute context_key

Returns:

  • (Object)

    the current value of context_key



4
5
6
# File 'lib/jsonapi/cached_response_fragment.rb', line 4

def context_key
  @context_key
end

#resource_klassObject

Returns the value of attribute resource_klass

Returns:

  • (Object)

    the current value of resource_klass



4
5
6
# File 'lib/jsonapi/cached_response_fragment.rb', line 4

def resource_klass
  @resource_klass
end

#serializer_config_keyObject

Returns the value of attribute serializer_config_key

Returns:

  • (Object)

    the current value of serializer_config_key



4
5
6
# File 'lib/jsonapi/cached_response_fragment.rb', line 4

def serializer_config_key
  @serializer_config_key
end

Instance Method Details

#keysObject



10
11
12
13
14
# File 'lib/jsonapi/cached_response_fragment.rb', line 10

def keys
  cache_ids.map do |(id, cache_key)|
    [type, id, cache_key, serializer_config_key, context_key]
  end
end

#typeObject



6
7
8
# File 'lib/jsonapi/cached_response_fragment.rb', line 6

def type
  resource_klass._type
end