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, is_primary, prefix) ⇒ Column

Returns a new instance of Column.



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

def initialize(key, heading, is_primary, prefix)
  @key = key
  @heading = heading
  @is_primary = is_primary
  @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

#is_primaryObject (readonly)

Returns the value of attribute is_primary.



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

def is_primary
  @is_primary
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



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

def assign_value(value)
  @value = value
end

#full_headingObject



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

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