Class: SimpleReport::Sheet

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, collection) ⇒ Sheet

Returns a new instance of Sheet.



5
6
7
8
9
# File 'lib/simple_report/sheet.rb', line 5

def initialize(name, collection)
  @name = name
  @collection = collection
  @fields = []
end

Instance Attribute Details

#collectionObject (readonly)

Returns the value of attribute collection.



3
4
5
# File 'lib/simple_report/sheet.rb', line 3

def collection
  @collection
end

#fieldsObject (readonly)

Returns the value of attribute fields.



3
4
5
# File 'lib/simple_report/sheet.rb', line 3

def fields
  @fields
end

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/simple_report/sheet.rb', line 3

def name
  @name
end

Instance Method Details

#add_field(name, field = nil, width: nil, format: nil, value: nil, force: nil, &block) ⇒ Object



11
12
13
# File 'lib/simple_report/sheet.rb', line 11

def add_field(name, field = nil, width: nil, format: nil, value: nil, force: nil, &block)
  @fields << Field.new(name, field, width: width, format: format, value: value, force: force, &block)
end