Class: Droonga::CommandRepository

Inherits:
Object
  • Object
show all
Defined in:
lib/droonga/command_repository.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeCommandRepository



19
20
21
# File 'lib/droonga/command_repository.rb', line 19

def initialize
  @commands = []
end

Instance Attribute Details

#commandsObject (readonly)

Returns the value of attribute commands.



18
19
20
# File 'lib/droonga/command_repository.rb', line 18

def commands
  @commands
end

Instance Method Details

#find(message) ⇒ Object



27
28
29
30
31
# File 'lib/droonga/command_repository.rb', line 27

def find(message)
  @commands.find do |command|
    command.match?(message)
  end
end

#register(command) ⇒ Object



23
24
25
# File 'lib/droonga/command_repository.rb', line 23

def register(command)
  @commands << command
end