Class: Graphiti::Util::SerializerAttributes
- Defined in:
- lib/graphiti/util/serializer_attributes.rb
Instance Method Summary collapse
- #apply ⇒ Object
-
#initialize(resource, attributes, extra = false) ⇒ SerializerAttributes
constructor
A new instance of SerializerAttributes.
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
#apply ⇒ Object
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 |