Class: Csb::Template

Inherits:
Object
  • Object
show all
Defined in:
lib/csb/template.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(utf8_bom:, streaming:) ⇒ Template

Returns a new instance of Template.



5
6
7
8
9
10
# File 'lib/csb/template.rb', line 5

def initialize(utf8_bom:, streaming:)
  @utf8_bom = utf8_bom
  @streaming = streaming
  @cols = Cols.new
  @items = []
end

Instance Attribute Details

#colsObject

Returns the value of attribute cols.



3
4
5
# File 'lib/csb/template.rb', line 3

def cols
  @cols
end

#filenameObject

Returns the value of attribute filename.



3
4
5
# File 'lib/csb/template.rb', line 3

def filename
  @filename
end

#itemsObject

Returns the value of attribute items.



3
4
5
# File 'lib/csb/template.rb', line 3

def items
  @items
end

#streamingObject

Returns the value of attribute streaming.



3
4
5
# File 'lib/csb/template.rb', line 3

def streaming
  @streaming
end

#utf8_bomObject

Returns the value of attribute utf8_bom.



3
4
5
# File 'lib/csb/template.rb', line 3

def utf8_bom
  @utf8_bom
end

Instance Method Details

#buildObject



12
13
14
# File 'lib/csb/template.rb', line 12

def build
  streaming ? build_enumerator : build_string
end

#streaming?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/csb/template.rb', line 16

def streaming?
  !!streaming
end