Sha256: 5ab9ffa923a7c5fac124041d2872dd83f793f9c480de76e9865b029c0c4540ce

Contents?: true

Size: 809 Bytes

Versions: 2

Compression:

Stored size: 809 Bytes

Contents

module Marvin
  module Util
      
      # Return the channel-name version of a string by
      # appending "#" to the front if it doesn't already
      # start with it.
      def channel_name(name)
        return name.to_s[0..0] == "#" ? name.to_s : "##{name}"
      end
      alias chan channel_name
      
      def arguments(input)
        prefix, *ending = input.split(":")
        prefix = prefix.split(" ")
        prefix << ending.join(":").strip
        return prefix
      end

      # Specifies the last parameter of a response, used to
      # specify parameters which have spaces etc (for example,
      # the actual message part of a response).
      def last_param(section)
        section && ":#{section.to_s.strip} "
      end
      alias lp last_param
     
      extend self
     
  end
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
Sutto-marvin-0.1.20081115 lib/marvin/util.rb
jeffrafter-marvin-0.1.20081115 lib/marvin/util.rb