Sha256: b1f2a424a948d6b678d3f7b50591b34a10d2f294b7457ace5dd208b21c6344c4

Contents?: true

Size: 350 Bytes

Versions: 8

Compression:

Stored size: 350 Bytes

Contents

module Ellen
  class Message
    attr_reader :body, :command, :match_data, :source

    def initialize(options)
      @body = options[:body]
      @source = options[:source]
      @command = options[:command]
    end

    def match(pattern)
      @match_data = pattern.match(body)
    end

    def [](index)
      match_data[index]
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
ellen-0.1.2 lib/ellen/message.rb
ellen-0.1.1 lib/ellen/message.rb
ellen-0.1.0 lib/ellen/message.rb
ellen-0.0.9 lib/ellen/message.rb
ellen-0.0.8 lib/ellen/message.rb
ellen-0.0.7 lib/ellen/message.rb
ellen-0.0.6 lib/ellen/message.rb
ellen-0.0.5 lib/ellen/message.rb