Class: Tabloid::ReportColumn

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key, label = "", options = {}) ⇒ ReportColumn

Returns a new instance of ReportColumn.



7
8
9
10
11
12
# File 'lib/tabloid/report_column.rb', line 7

def initialize(key, label = "", options={})
  self.key = key
  self.label = label
  @hidden =  options[:hidden]
  @total = options[:total]
end

Instance Attribute Details

#hiddenObject

Returns the value of attribute hidden.



5
6
7
# File 'lib/tabloid/report_column.rb', line 5

def hidden
  @hidden
end

#keyObject

Returns the value of attribute key.



3
4
5
# File 'lib/tabloid/report_column.rb', line 3

def key
  @key
end

#labelObject

Returns the value of attribute label.



4
5
6
# File 'lib/tabloid/report_column.rb', line 4

def label
  @label
end

Instance Method Details

#hidden?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/tabloid/report_column.rb', line 22

def hidden?
  hidden
end

#to_headerObject



26
27
28
29
# File 'lib/tabloid/report_column.rb', line 26

def to_header
  return self.label if label
  return self.key
end

#to_sObject



14
15
16
# File 'lib/tabloid/report_column.rb', line 14

def to_s
  @key.to_s
end

#total?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/tabloid/report_column.rb', line 18

def total?
  @total
end