Class: WAB::OpenController

Inherits:
Controller show all
Defined in:
lib/wab/open_controller.rb

Overview

This controller exposes all possible methods expected in a WAB::Controller subclass, as public methods.

Since those methods are private in the superclass, they need to be redefined as public methods to enable the concerned functionality.

For example, if a controller is intented to provide only read-access, then just the read method would need to be exposed as a public method. The remaining methods may remain private.

Instance Attribute Summary

Attributes inherited from Controller

#shell

Instance Method Summary collapse

Constructor Details

#initialize(shell) ⇒ OpenController

Returns a new instance of OpenController.



15
16
17
# File 'lib/wab/open_controller.rb', line 15

def initialize(shell)
  super(shell)
end

Instance Method Details

#create(path, query, data) ⇒ Object



26
27
28
# File 'lib/wab/open_controller.rb', line 26

def create(path, query, data)
  super
end

#delete(path, query) ⇒ Object



38
39
40
# File 'lib/wab/open_controller.rb', line 38

def delete(path, query)
  super
end

#handle(data) ⇒ Object

Catch requests that are not one of the below CRUD methods.

Raises as it has to be handled specially.

Raises:

  • (NotImplementedError)


22
23
24
# File 'lib/wab/open_controller.rb', line 22

def handle(data)
  raise NotImplementedError.new
end

#read(path, query) ⇒ Object



30
31
32
# File 'lib/wab/open_controller.rb', line 30

def read(path, query)
  super
end

#update(path, query, data) ⇒ Object



34
35
36
# File 'lib/wab/open_controller.rb', line 34

def update(path, query, data)
  super
end