Class: Auth::Shopping::ShoppingController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/auth/shopping/shopping_controller.rb

Instance Method Summary collapse

Instance Method Details

#instantiate_cart_classObject



40
41
42
43
44
45
46
47
48
49
50
# File 'app/controllers/auth/shopping/shopping_controller.rb', line 40

def instantiate_cart_class
	if @auth_shopping_cart_class = Auth.configuration.cart_class
      begin
        @auth_shopping_cart_class = @auth_shopping_cart_class.constantize
      rescue
        not_found("error instantiating class from cart class")
      end
    else
      not_found("cart class not specified in configuration")
    end
end

#instantiate_cart_item_classObject



53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'app/controllers/auth/shopping/shopping_controller.rb', line 53

def instantiate_cart_item_class

    if @auth_shopping_cart_item_class = Auth.configuration.cart_item_class
      begin
        @auth_shopping_cart_item_class = @auth_shopping_cart_item_class.constantize
      rescue
        not_found("error instatiating class from cart item class")
      end
    else
      not_found("cart item class not specified in configuration")
    end

end

#instantiate_discount_classObject



3
4
5
6
7
8
9
10
11
12
13
# File 'app/controllers/auth/shopping/shopping_controller.rb', line 3

def instantiate_discount_class
	if @auth_shopping_discount_class = Auth.configuration.discount_class
      begin
        @auth_shopping_discount_class = @auth_shopping_discount_class.constantize
      rescue
        not_found("error instantiating class from discount class")
      end
    else
      not_found("discount class not specified in configuration")
    end
end

#instantiate_payment_classObject



68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'app/controllers/auth/shopping/shopping_controller.rb', line 68

def instantiate_payment_class

	if @auth_shopping_payment_class = Auth.configuration.payment_class
      begin
        @auth_shopping_payment_class = @auth_shopping_payment_class.constantize
      rescue
        not_found("error instatiating class from payment class")
      end
    else
      not_found("payment class not specified in configuration")
    end

end

#instantiate_personality_classObject



27
28
29
30
31
32
33
34
35
36
37
# File 'app/controllers/auth/shopping/shopping_controller.rb', line 27

def instantiate_personality_class
	if @auth_shopping_personality_class = Auth.configuration.personality_class
      begin
        @auth_shopping_personality_class = @auth_shopping_personality_class.constantize
      rescue
        not_found("error instantiating class from personality class")
      end
    else
      not_found("personality class not specified in configuration")
    end
end

#instantiate_place_classObject



15
16
17
18
19
20
21
22
23
24
25
# File 'app/controllers/auth/shopping/shopping_controller.rb', line 15

def instantiate_place_class
	if @auth_shopping_place_class = Auth.configuration.place_class
      begin
        @auth_shopping_place_class = @auth_shopping_place_class.constantize
      rescue
        not_found("error instantiating class from place class")
      end
    else
      not_found("place class not specified in configuration")
    end
end

#instantiate_product_classObject



82
83
84
85
86
87
88
89
90
91
92
93
94
95
# File 'app/controllers/auth/shopping/shopping_controller.rb', line 82

def instantiate_product_class

	if @auth_shopping_product_class = Auth.configuration.product_class
      begin
        @auth_shopping_product_class = @auth_shopping_product_class.constantize
      rescue => e
      	puts e.to_s
        not_found("error instatiating class from product class")
      end
    else
      not_found("product class not specified in configuration")
    end

end

#instantiate_shopping_classesObject



100
101
102
103
104
105
106
107
108
# File 'app/controllers/auth/shopping/shopping_controller.rb', line 100

def instantiate_shopping_classes
	instantiate_payment_class
	instantiate_cart_class
	instantiate_cart_item_class
	instantiate_product_class
	instantiate_discount_class
	instantiate_personality_class
	instantiate_place_class
end