Class: NtiReceiptBuilder::RenderResult

Inherits:
Object
  • Object
show all
Defined in:
lib/nti_receipt_builder/render_result.rb

Overview

The output of one render: presenters in paint order, whether the content overflows the printable area, and how tall it actually is. Not cached — one per render, holding no references after the response.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(elements:, overflow:, content_height_mm:) ⇒ RenderResult

Returns a new instance of RenderResult.



10
11
12
13
14
# File 'lib/nti_receipt_builder/render_result.rb', line 10

def initialize(elements:, overflow:, content_height_mm:)
  @elements = elements
  @overflow = overflow
  @content_height_mm = content_height_mm
end

Instance Attribute Details

#content_height_mmObject (readonly)

Returns the value of attribute content_height_mm.



8
9
10
# File 'lib/nti_receipt_builder/render_result.rb', line 8

def content_height_mm
  @content_height_mm
end

#elementsObject (readonly)

Returns the value of attribute elements.



8
9
10
# File 'lib/nti_receipt_builder/render_result.rb', line 8

def elements
  @elements
end

Instance Method Details

#overflow?Boolean

Returns:

  • (Boolean)


16
# File 'lib/nti_receipt_builder/render_result.rb', line 16

def overflow? = @overflow