Module: Navigable::Server::EndpointCommand::ClassMethods
- Defined in:
- lib/navigable/server/endpoint_command.rb
Instance Method Summary collapse
- #corresponds_to(command_key) ⇒ Object
- #ready_for_setup? ⇒ Boolean
- #responds_to(verb, path) ⇒ Object
- #setup_endpoint_command ⇒ Object
Instance Method Details
#corresponds_to(command_key) ⇒ Object
20 21 22 23 24 25 26 27 |
# File 'lib/navigable/server/endpoint_command.rb', line 20 def corresponds_to(command_key) @corresponds_to_proc ||= Proc.new do |endpoint_klass, command_klass| endpoint_klass.executes(command_key) super(command_key) end setup_endpoint_command if ready_for_setup? end |
#ready_for_setup? ⇒ Boolean
35 36 37 |
# File 'lib/navigable/server/endpoint_command.rb', line 35 def ready_for_setup? @responds_to_proc && @corresponds_to_proc end |
#responds_to(verb, path) ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/navigable/server/endpoint_command.rb', line 12 def responds_to(verb, path) @responds_to_proc ||= Proc.new do |endpoint_klass| endpoint_klass.responds_to(verb, path) end setup_endpoint_command if ready_for_setup? end |