Class: GraphDecoration

Inherits:
Object
  • Object
show all
Defined in:
lib/graph_decorator.rb

Overview

decorator class – this serves as the superclass for all the concrete decorators

Instance Method Summary collapse

Constructor Details

#initialize(real_graph) ⇒ GraphDecoration

initialises the decorator object declared in the appliation, which is the compnonent class object mostly in the paramters



31
32
33
# File 'lib/graph_decorator.rb', line 31

def initialize(real_graph)
  @real_graph = real_graph
end

Instance Method Details

#doubleChartObject

returns pizza chart gem function to build the graph with the data from its concrete decorator classes and from basic class with the data type of the chart



41
42
43
# File 'lib/graph_decorator.rb', line 41

def doubleChart
  return Charting.doublechart(@x_name, @y_data_1, @y_name_1, @y_data_2, @y_name_2, @real_graph.doubleChart)
end

#multipleChartObject

returns pizza chart gem function to build the graph with the data from its concrete decorator classes and from basic class with the data type of the chart



46
47
48
# File 'lib/graph_decorator.rb', line 46

def multipleChart
  return Charting.multichart(@x_name, @y_data_1, @y_name_1, @y_data_2, @y_name_2, @y_data_3, @y_name_3, @real_graph.multipleChart)
end

#singleChartObject

returns pizza chart gem function to build the graph with the data from its concrete decorator classes and from basic class with the data type of the chart



36
37
38
# File 'lib/graph_decorator.rb', line 36

def singleChart
  return Charting.singlechart(@x_name, @y_data_1, @y_name_1, @real_graph.singleChart)
end