Skip to content

undefined method `=~' for [:ReturnEnvelope, :Boolean]:Array (NoMethodError) #239

Description

@elcous
ETHON: Libcurl initialized
ETHON: performed EASY effective_url=https://api.lob.com/v1/letters response_code=200 return_code=ok total_time=0.519936
/Users/.../.local/share/mise/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/lob-6.0.9/lib/lob/models/letter.rb:609:in `block in build_from_hash': undefined method `=~' for [:ReturnEnvelope, :Boolean]:Array (NoMethodError)

to recreate

with test credentials Create a letter

def call
      letter_api = Lob::LettersApi.new
      response = letter_api.create(letter_params)
    end

    private

    def letter_params
      Lob::LetterEditable.new(
        description:,
        to: address_params(to_address),
        from: address_params(from_address),
        file: html_content,
        merge_variables:,
        color: false,
        use_type: 'operational'
      )
    end

    def address_params(address)
      # rubocop:disable Naming/VariableNumber
      Lob::AddressEditable.new(
        name: address.name,
        address_line1: address.street_address,
        address_line2: address.street_address_2,
        address_city: address.city,
        address_state: address.state,
        address_zip: address.zip_code
      )
      # rubocop:enable Naming/VariableNumber
    end

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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