Class: OldSql::ReportDesign::ChartItem

Inherits:
Object
  • Object
show all
Defined in:
lib/old_sql/report_design/chart_item.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(slice) ⇒ ChartItem

Returns a new instance of ChartItem.



6
7
8
9
10
11
12
# File 'lib/old_sql/report_design/chart_item.rb', line 6

def initialize(slice)
  @key = slice['title']
  @data = slice['data']
  @chart_data = []
  
  @data.split(" ").each {|chart_data| @chart_data << ChartData.new(chart_data)}
end

Instance Attribute Details

#chart_dataObject

Returns the value of attribute chart_data.



4
5
6
# File 'lib/old_sql/report_design/chart_item.rb', line 4

def chart_data
  @chart_data
end

#keyObject

Returns the value of attribute key.



4
5
6
# File 'lib/old_sql/report_design/chart_item.rb', line 4

def key
  @key
end

Instance Method Details

#expression?Boolean

Returns:

  • (Boolean)


14
15
16
17
18
19
20
# File 'lib/old_sql/report_design/chart_item.rb', line 14

def expression?
  if @chart_data.count>1
    return true
  else
    return false
  end
end