Skip to content
This repository was archived by the owner on Mar 12, 2024. It is now read-only.
This repository was archived by the owner on Mar 12, 2024. It is now read-only.

Passing Context or Options to Serializers #2

@nbibler

Description

@nbibler

Right now, using the map DSL, it seems like there's no simple way to have access to a serializer context, methods, or options.

class MySerializer < Ivy::Serializers::Serializer
  def self.common_function(resource, name)
    # ...
  end

  def common_function(resource, name)
    # ...
  end

  map MyKlass do
    attribute(:foo) { |mk| common_function(mk, :foo) }
  end
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions