Skip to content

Representable 4: problem when parsing looks at one field but wants to create two #268

@apotonick

Description

@apotonick
      class Representer < Representable::Decorator
        include Representable::Hash

# Problem: we want to serialize jwt_token_exp, and NOT expires_at
#           we want to deserialize jwt_token_exp AND expires_at with its own parsing logic applied.
        # property :expires_at
        property :expires_at,
          parse_filter: ->(fragment, options) { Trace.parse_exp(fragment) },
          as: :jwt_token_exp, readable: false
        property :jwt_token_exp # FIXME: this is not clean. expires_at will be overridden with jwt_token_exp when serializing.
        property :id_token
        property :refresh_token
        property :api_key
        property :trailblazer_pro_host
        property :firebase_upload_url
        property :firestore_fields_template
        property :firebase_refresh_url
        property :firebase_signin_url
      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