<commit_before># frozen_string_literal: true

module SolidusEasypost
  module Spree
    module AddressDecorator
      def easypost_address
        attributes = {
          street1: address1,
          street2: address2,
          city: city,
          zip: zipcode,
          phone: phone
        }

        attributes[:company] = company if respond_to?(:company)
        attributes[:name] = full_name if respond_to?(:full_name)
        attributes[:state] = state ? state.abbr : state_name
        attributes[:country] = country&.iso

        ::EasyPost::Address.create attributes
      end

      ::Spree::Address.prepend self<commit_msg>Fix deprecation warning for Spree::Address#full_name<commit_after># frozen_string_literal: true

module SolidusEasypost
  module Spree
    module AddressDecorator
      def easypost_address
        attributes = {
          street1: address1,
          street2: address2,
          city: city,
          zip: zipcode,
          phone: phone
        }

        attributes[:company] = company if respond_to?(:company)
        attributes[:name] = if respond_to?(:name)
          name
        elsif respond_to?(:full_name)
          full_name
        end
        attributes[:state] = state ? state.abbr : state_name
        attributes[:country] = country&.iso

        ::EasyPost::Address.create attributes
      end

      ::Spree::Address.prepend self
{'fraction_non_alphanumeric': 0.08579668348954578, 'fraction_numerical': 0.005767844268204758, 'mean_word_length': 2.3126491646778042, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2276117', 'n_tokens_mistral': 393, 'n_tokens_neox': 381, 'n_words': 89}