Class: Zertico::Controller

Inherits:
ActionController::Base
  • Object
show all
Defined in:
lib/zertico/controller.rb

Instance Method Summary collapse

Constructor Details

#initializeController

Returns a new instance of Controller.



5
6
7
8
9
10
11
12
# File 'lib/zertico/controller.rb', line 5

def initialize
  begin
    extend "::#{self.class.name.chomp('Controller').concat('Service')}".constantize
  rescue NameError
    extend Zertico::Service
  end
  super
end

Instance Method Details

#createObject



30
31
32
# File 'lib/zertico/controller.rb', line 30

def create
  respond_with(generate, options)
end

#destroyObject



38
39
40
# File 'lib/zertico/controller.rb', line 38

def destroy
  respond_with(delete, options)
end

#editObject



26
27
28
# File 'lib/zertico/controller.rb', line 26

def edit
  respond_with(find, options)
end

#indexObject



14
15
16
# File 'lib/zertico/controller.rb', line 14

def index
  respond_with(all, options)
end

#newObject



18
19
20
# File 'lib/zertico/controller.rb', line 18

def new
  respond_with(build, options)
end

#optionsObject



42
43
44
# File 'lib/zertico/controller.rb', line 42

def options
  @options || {}
end

#showObject



22
23
24
# File 'lib/zertico/controller.rb', line 22

def show
  respond_with(find, options)
end

#updateObject



34
35
36
# File 'lib/zertico/controller.rb', line 34

def update
  respond_with(modify, options)
end