Class: SimpleReport::Sheet
- Inherits:
-
Object
- Object
- SimpleReport::Sheet
- Defined in:
- lib/simple_report/sheet.rb
Instance Attribute Summary collapse
-
#collection ⇒ Object
readonly
Returns the value of attribute collection.
-
#fields ⇒ Object
readonly
Returns the value of attribute fields.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #add_field(name, field = nil, width: nil, format: nil, value: nil, force: nil, &block) ⇒ Object
-
#initialize(name, collection) ⇒ Sheet
constructor
A new instance of Sheet.
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
#collection ⇒ Object (readonly)
Returns the value of attribute collection.
3 4 5 |
# File 'lib/simple_report/sheet.rb', line 3 def collection @collection end |
#fields ⇒ Object (readonly)
Returns the value of attribute fields.
3 4 5 |
# File 'lib/simple_report/sheet.rb', line 3 def fields @fields end |
#name ⇒ Object (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 |