Class: DynamicPDFApi::DlexInput
- Defined in:
- lib/ruby_client/DlexInput.rb
Overview
Represents a Dlex input.
Instance Attribute Summary collapse
-
#layout_data_resource_name ⇒ Object
Gets or sets the name for layout data resource.
Attributes inherited from Input
#_resources, #_template_id, #_type, #id, #resource_name
Instance Method Summary collapse
-
#initialize(dlex, layout) ⇒ DlexInput
constructor
Initializes a new instance of the DlexInput class by posting the DLEX file and the JSON data file from the client to the API to create the PDF report.
- #to_json(_options = {}) ⇒ Object
Methods inherited from Input
Constructor Details
#initialize(dlex, layout) ⇒ DlexInput
Initializes a new instance of the DlexInput class by posting the DLEX file and the JSON data file from the client to the API to create the PDF report.
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/ruby_client/DlexInput.rb', line 18 def initialize(dlex, layout) super() @_resources = [] @_type = InputType::DLEX if (dlex.is_a?(String)) == true && layout.is_a?(String) # super() @resource_name = dlex @layout_data_resource_name = layout elsif (dlex.is_a?(String)) == true && layout.is_a?(Object) @resource_name = dlex @layout_data_resource_name = layout.layout_data_resource_name @_resources << layout elsif (dlex.is_a?(Object)) == true && layout.is_a?(Object) @resource_name = dlex.resource_name @layout_data_resource_name = layout.layout_data_resource_name # dlex.LayoutDataResourceName=@LayoutDataResourceName @_resources << layout @_resources << dlex end end |
Instance Attribute Details
#layout_data_resource_name ⇒ Object
Gets or sets the name for layout data resource.
44 45 46 |
# File 'lib/ruby_client/DlexInput.rb', line 44 def layout_data_resource_name @layout_data_resource_name end |
Instance Method Details
#to_json(_options = {}) ⇒ Object
46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/ruby_client/DlexInput.rb', line 46 def to_json( = {}) json_array = {} json_array['type'] = 'dlex' json_array['layoutDataResourceName'] = @layout_data_resource_name #--------------------------------------------------- json_array['templateId'] = @_template_id unless @_template_id.nil? json_array['resourceName'] = @resource_name unless @resource_name.nil? json_array['id'] = @id unless @id.nil? JSON.pretty_generate(json_array) end |