Sha256: c8f284e43f6e9b644486639e9d6c49946b2623b163901ce26c5f98ef0d40b3fc

Contents?: true

Size: 647 Bytes

Versions: 1

Compression:

Stored size: 647 Bytes

Contents

class ExceptionNotification::Parser::Subject
  attr_reader \
    :action_name,
    :controller_name,
    :email_prefix,
    :exception_class_name

  def initialize(subject)
    @subject = subject
    if %r!^([^ ]+) \(([^)]+)\)!m =~ subject
      @email_predix = $1
      @controller_name = nil
      @action_name = nil
      @exception_class_name = $2
      return
    end

    if %r!([^ ]+) ([^#]+?)#(\w+) \(([^\)]+?)\)!m =~ subject
      @email_prefix = $1
      @controller_name = $2
      @action_name = $3
      @exception_class_name = $4
      return
    end

    raise('no match pattaern subject!')
  end

  def to_s
    @subject
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
exception_notification-parser-0.1.0 lib/exception_notification/parser/subject.rb