#47 ✓resolved
jugyo

Termtter::Command をちょっとだけ改良する

Reported by jugyo | March 18th, 2009 @ 10:54 AM | in ver.1.1

Termtter::Command をちょっとだけ改良したいです。

現状の match? メソッドがなんかきもい感じ。

経緯としては、以下のような形でコマンドを定義できるということに今更ながら気づき、この方式だと現状の match? メソッドに期待される動きが若干直感的じゃないなぁ、という感じです。


module Termtter
  class TestCommand < Command
    def initialize
      super(:name => :test)
    end 

    def execute(arg)
      puts 'execute!!'
    end 

    def match?(arg)
      true
    end 
  end 

  Client.register_command(TestCommand.new)
end

Comments and changes to this ticket

  • jugyo

    jugyo March 22nd, 2009 @ 11:18 PM

    • State changed from “new” to “resolved”

    done.

    その他に、execute メソッドが call になり cmd, arg, original_text という引数を受け取るようになった。

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Termtter is a terminal based Twitter client

People watching this ticket

Pages