Class: Graphiti::Util::SerializerAttributes

Inherits:
Object
  • Object
show all
Defined in:
lib/graphiti/util/serializer_attributes.rb

Instance Method Summary collapse

Constructor Details

#initialize(resource, attributes, extra = false) ⇒ SerializerAttributes

Returns a new instance of SerializerAttributes.



153
154
155
156
157
158
# File 'lib/graphiti/util/serializer_attributes.rb', line 153

def initialize(resource, attributes, extra = false)
  @resource = resource
  @serializer = resource.serializer
  @attributes = attributes
  @extra = extra
end

Instance Method Details

#applyObject



160
161
162
163
164
165
# File 'lib/graphiti/util/serializer_attributes.rb', line 160

def apply
  @attributes.each_pair do |name, attr|
    SerializerAttribute
      .new(name, attr, @resource, @serializer, @extra).apply
  end
end