Sha256: 6e067dee1864c70ff0934a47c22f60014e669cfa06aa27aed23a5582753f685f

Contents?: true

Size: 591 Bytes

Versions: 4

Compression:

Stored size: 591 Bytes

Contents

# frozen_string_literal: true
module EmailInquire

  class Response

    attr_accessor :email, :replacement, :status

    def hint!(domain: nil)
      self.status = :hint

      old_name, _old_domain = email.split("@")
      self.replacement = "#{old_name}@#{domain}" if domain
    end

    def hint?
      status == :hint
    end

    def invalid!
      self.status = :invalid
    end

    def invalid?
      status == :invalid
    end

    def status?
      !status.nil?
    end

    def valid!
      self.status = :valid
    end

    def valid?
      status == :valid
    end

  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
email_inquire-0.4.0 lib/email_inquire/response.rb
email_inquire-0.3.0 lib/email_inquire/response.rb
email_inquire-0.2.0 lib/email_inquire/response.rb
email_inquire-0.1.0 lib/email_inquire/response.rb