Skip to content

Readme appears wrong and api won't initialize #21

@scottmessinger

Description

@scottmessinger

Hi!

Thanks for creating this! I'm trying to get it working and am running into some issues.

First, there is not Prismic.V2.API. That commit to the README happened early in the life of the project and, as far as I can tell, there has never been a Prismic.V2 module.

Second, when I try to init the api (or do Prismic.all), I get this:

iex(6)> Prismic.api("https://my-repo.cdn.prismic.io/api/v2")
** (Protocol.UndefinedError) protocol Enumerable not implemented for 
%Prismic.API{access_token: nil, bookmarks: nil, forms: nil, refs: [%Prismic.Ref{id: nil, isMasterRef: false, label: nil, ref: nil, scheduledAt: nil}], repository_url: "https://cc-homepage.cdn.prismic.io/api/v2"}. 
This protocol is implemented for: [snip...]

I've added defimpl Enumerable, for: Prismic.Ref do ... and defimpl Enumerable, for: Prismic.API do... and then I just get ** (UndefinedFunctionError) function nil.__struct__/0 is undefined. If you are using the dot syntax, such as map.field or module.function, make sure the left side of the dot is an atom or a map.

Am I'm just grossly misunderstanding the API? Let me know!

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