Skip to content

preview_image_url should handle unspecified capture size with options more gracefully #3

@rahim

Description

@rahim

Currently this happens:

2.2.2 (main):0 > Litmus::Instant.preview_image_url(email_guid, "OL2010", images: "blocked")
=> "https://OL2010.instant-api.litmus.com/v1/emails/755d1f9f-ad28-460f-8e45-632e0eceab32/previews/OL2010/{:images=>\"blocked\"}"

This is mostly a consequence of supporting 1.9.x rather than using 2.x keyword args.

We can maintain 1.9.x support by detecting whether the third arg (capture_size) is a Hash or string, if a Hash assume it's the options, and use the default capture_size.

Alternatively (given we're yet to release) we could change the method signature and move capture_size in to the options hash too.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions