Class: Pocketbook::RenderRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/pocketbook/render_request.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(inputs:, theme_path:, style: nil, template_override: nil, output_path:, metadata: {}, debounce_ms: 350, diagnostics: false, open_output: false) ⇒ RenderRequest

Returns a new instance of RenderRequest.



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/pocketbook/render_request.rb', line 5

def initialize(
  inputs:,
  theme_path:,
  style: nil,
  template_override: nil,
  output_path:,
  metadata: {},
  debounce_ms: 350,
  diagnostics: false,
  open_output: false
)
  @inputs = normalize_inputs(inputs)
  @theme_path = normalize_required_string(theme_path, "theme_path")
  @style = normalize_optional_string(style)
  @template_override = normalize_optional_string(template_override)
  @output_path = normalize_required_string(output_path, "output_path")
  @metadata = symbolize_keys( || {}).freeze
  @debounce_ms = normalize_debounce_ms(debounce_ms)
  @diagnostics = !!diagnostics
  @open_output = !!open_output

  freeze
end

Instance Attribute Details

#debounce_msObject (readonly)

Returns the value of attribute debounce_ms.



3
4
5
# File 'lib/pocketbook/render_request.rb', line 3

def debounce_ms
  @debounce_ms
end

#diagnosticsObject (readonly)

Returns the value of attribute diagnostics.



3
4
5
# File 'lib/pocketbook/render_request.rb', line 3

def diagnostics
  @diagnostics
end

#inputsObject (readonly)

Returns the value of attribute inputs.



3
4
5
# File 'lib/pocketbook/render_request.rb', line 3

def inputs
  @inputs
end

#metadataObject (readonly)

Returns the value of attribute metadata.



3
4
5
# File 'lib/pocketbook/render_request.rb', line 3

def 
  @metadata
end

#open_outputObject (readonly)

Returns the value of attribute open_output.



3
4
5
# File 'lib/pocketbook/render_request.rb', line 3

def open_output
  @open_output
end

#output_pathObject (readonly)

Returns the value of attribute output_path.



3
4
5
# File 'lib/pocketbook/render_request.rb', line 3

def output_path
  @output_path
end

#styleObject (readonly)

Returns the value of attribute style.



3
4
5
# File 'lib/pocketbook/render_request.rb', line 3

def style
  @style
end

#template_overrideObject (readonly)

Returns the value of attribute template_override.



3
4
5
# File 'lib/pocketbook/render_request.rb', line 3

def template_override
  @template_override
end

#theme_pathObject (readonly)

Returns the value of attribute theme_path.



3
4
5
# File 'lib/pocketbook/render_request.rb', line 3

def theme_path
  @theme_path
end