Class: ReturningCustomers
- Inherits:
-
GraphDecoration
- Object
- GraphDecoration
- ReturningCustomers
- Defined in:
- lib/graph_decorator.rb
Overview
a concrete decorator provides the data for the super class decorator according to the requirement of single colum or double column or triple column.
Instance Method Summary collapse
-
#initialize(real_graph) ⇒ ReturningCustomers
constructor
this functionality initialises with the data from the application models.
Methods inherited from GraphDecoration
#doubleChart, #multipleChart, #singleChart
Constructor Details
#initialize(real_graph) ⇒ ReturningCustomers
this functionality initialises with the data from the application models
222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 |
# File 'lib/graph_decorator.rb', line 222 def initialize(real_graph) super(real_graph) @y_name_1 = "New Cusomtomers" @y_name_2 = "Frequent Customers" @y_name_3 = "Total no of sign in count in this website" @cust_new = 0 @customer_return = 0 @new_customer_count = Member.select("sign_in_count").group_by{|o| o.sign_in_count}.keys @new_customer_count.each do |cust| if cust > 3 @customer_return += 1 else @cust_new += 1 end end @y_data_1 = @cust_new @y_data_2 = @customer_return @x_name = ['new customer', 'old customer'] @y_data_3 = Member.sum("sign_in_count") end |