Class: Droonga::CommandRepository
- Inherits:
-
Object
- Object
- Droonga::CommandRepository
- Defined in:
- lib/droonga/command_repository.rb
Instance Attribute Summary collapse
-
#commands ⇒ Object
readonly
Returns the value of attribute commands.
Instance Method Summary collapse
- #find(message) ⇒ Object
-
#initialize ⇒ CommandRepository
constructor
A new instance of CommandRepository.
- #register(command) ⇒ Object
Constructor Details
#initialize ⇒ CommandRepository
19 20 21 |
# File 'lib/droonga/command_repository.rb', line 19 def initialize @commands = [] end |
Instance Attribute Details
#commands ⇒ Object (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() @commands.find do |command| command.match?() end end |
#register(command) ⇒ Object
23 24 25 |
# File 'lib/droonga/command_repository.rb', line 23 def register(command) @commands << command end |