Class: MagicReport::Report::Row::Column

Inherits:
Object
  • Object
show all
Defined in:
lib/magic_report/report/row.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key, heading, prefix) ⇒ Column

Returns a new instance of Column.



9
10
11
12
13
14
# File 'lib/magic_report/report/row.rb', line 9

def initialize(key, heading, prefix)
  @key = key
  @heading = heading
  @prefix = prefix
  @value = nil
end

Instance Attribute Details

#headingObject (readonly)

Returns the value of attribute heading.



7
8
9
# File 'lib/magic_report/report/row.rb', line 7

def heading
  @heading
end

#keyObject (readonly)

Returns the value of attribute key.



7
8
9
# File 'lib/magic_report/report/row.rb', line 7

def key
  @key
end

#prefixObject (readonly)

Returns the value of attribute prefix.



7
8
9
# File 'lib/magic_report/report/row.rb', line 7

def prefix
  @prefix
end

#valueObject (readonly)

Returns the value of attribute value.



7
8
9
# File 'lib/magic_report/report/row.rb', line 7

def value
  @value
end

Instance Method Details

#assign_value(value) ⇒ Object



16
17
18
# File 'lib/magic_report/report/row.rb', line 16

def assign_value(value)
  @value = value
end

#full_headingObject



20
21
22
# File 'lib/magic_report/report/row.rb', line 20

def full_heading
  prefix ? "#{prefix} #{heading}" : heading
end