Sha256: a426c625e984a5e3a6e81ea615a9bf24e953d33a0ed6522e9f3a38eae8fc63c7

Contents?: true

Size: 792 Bytes

Versions: 1

Compression:

Stored size: 792 Bytes

Contents

# frozen_string_literal: true

require 'dsn/status_code'
require 'dsn/message'
require 'dsn/version'

require 'dsn/parser/string'

require 'dsn/subcode/base'
require 'dsn/subcode/class_subcode'
require 'dsn/subcode/subject_subcode'
require 'dsn/subcode/detail_subcode'

# Ruby parser for RFC 3463 Delivery Status Notification codes
module DSN
  # Raised when the status code is unparsable.
  class InvalidStatusCode < StandardError; end

  # Raised when attempting to operate on an invalid subcode.
  class InvalidSubcode < StandardError; end

  # Parse a StatsCode from a String
  def self.new(*args)
    StatusCode.new(Parser::String.new(*args))
  end

  # Return the most detailed Message possible from a String code
  def self.message(*args)
    Message.new(new(*args).subcode)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dsn-0.1.0 lib/dsn.rb