Since attributes are an instantiated class now, renamed AttributeSerializer to Attribute

This commit is contained in:
Trevor Hinesley 2018-06-21 16:06:18 -05:00 committed by Shishir Kakaraddi
parent 5c820695b3
commit ba4e112829
2 changed files with 3 additions and 3 deletions

View File

@ -1,5 +1,5 @@
module FastJsonapi
class AttributeSerializer
class Attribute
attr_reader :key, :method, :conditional_proc
def initialize(key:, method:, options: {})

View File

@ -3,7 +3,7 @@
require 'active_support/core_ext/object'
require 'active_support/concern'
require 'active_support/inflector'
require 'fast_jsonapi/attribute_serializer'
require 'fast_jsonapi/attribute'
require 'fast_jsonapi/serialization_core'
module FastJsonapi
@ -156,7 +156,7 @@ module FastJsonapi
attributes_list.each do |attr_name|
method_name = attr_name
key = run_key_transform(method_name)
attributes_to_serialize[key] = AttributeSerializer.new(
attributes_to_serialize[key] = Attribute.new(
key: key,
method: block || method_name,
options: options