Sha256: accad418efcfdb608d62036018eea4437043f109e7d960e8c2a0894d64691e2f

Contents?: true

Size: 268 Bytes

Versions: 22

Compression:

Stored size: 268 Bytes

Contents

module Ruboty
  module Actions
    class Ping < Base
      def call
        message.reply(pong)
      end

      private

      def ping
        message.body[-4..-1]
      end

      def pong
        ping.gsub(/i/i, "i" => "o", "I" => "O")
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
ruboty-1.3.1 lib/ruboty/actions/ping.rb
ruboty-1.3.0 lib/ruboty/actions/ping.rb
ruboty-1.2.4 lib/ruboty/actions/ping.rb
ruboty-1.2.3 lib/ruboty/actions/ping.rb
ruboty-1.2.2 lib/ruboty/actions/ping.rb
ruboty-1.2.1 lib/ruboty/actions/ping.rb
ruboty-1.2.0 lib/ruboty/actions/ping.rb
ruboty-1.1.9 lib/ruboty/actions/ping.rb
ruboty-1.1.8 lib/ruboty/actions/ping.rb
ruboty-1.1.7 lib/ruboty/actions/ping.rb
ruboty-1.1.6 lib/ruboty/actions/ping.rb
ruboty-1.1.5 lib/ruboty/actions/ping.rb
ruboty-1.1.4 lib/ruboty/actions/ping.rb
ruboty-1.1.3 lib/ruboty/actions/ping.rb
ruboty-1.1.2 lib/ruboty/actions/ping.rb
ruboty-1.1.1 lib/ruboty/actions/ping.rb
ruboty-1.1.0 lib/ruboty/actions/ping.rb
ruboty-1.0.4 lib/ruboty/actions/ping.rb
ruboty-1.0.3 lib/ruboty/actions/ping.rb
ruboty-1.0.2 lib/ruboty/actions/ping.rb