Class: DynamicPDFApi::HtmlInput
- Inherits:
-
ConverterInput
- Object
- Input
- ConverterInput
- DynamicPDFApi::HtmlInput
- Defined in:
- lib/ruby_client/HtmlInput.rb
Overview
Represents a html input.
Instance Attribute Summary collapse
-
#base_path ⇒ Object
Gets or sets the base path option.
Attributes inherited from ConverterInput
#_larger, #_smaller, #bottom_margin, #left_margin, #page_height, #page_width, #right_margin, #top_margin
Attributes inherited from Input
#_resources, #_template_id, #_type, #id, #resource_name
Instance Method Summary collapse
-
#initialize(resource, base_path = nil, size = nil, orientation = nil, margins = nil) ⇒ HtmlInput
constructor
Initializes a new instance of the HtmlInput class.
- #to_json(_options = {}) ⇒ Object
Methods inherited from ConverterInput
#page_orientation=, #page_size=
Methods inherited from Input
Constructor Details
#initialize(resource, base_path = nil, size = nil, orientation = nil, margins = nil) ⇒ HtmlInput
Initializes a new instance of the HtmlInput class.
16 17 18 19 20 21 22 23 24 |
# File 'lib/ruby_client/HtmlInput.rb', line 16 def initialize(resource, base_path = nil, size = nil, orientation = nil, margins = nil) super(resource, size, orientation, margins) @_type = InputType::HTML if (base_path != nil) @base_path = base_path end end |
Instance Attribute Details
#base_path ⇒ Object
Gets or sets the base path option.
29 30 31 |
# File 'lib/ruby_client/HtmlInput.rb', line 29 def base_path @base_path end |
Instance Method Details
#to_json(_options = {}) ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/ruby_client/HtmlInput.rb', line 31 def to_json( = {}) json_array = {} json_array["type"] = "html" json_array["basePath"] = @scale_x unless @scale_x.nil? json_array["topMargin"] = @top_margin unless @top_margin.nil? json_array["leftMargin"] = @left_margin unless @left_margin.nil? json_array["bottomMargin"] = @bottom_margin unless @bottom_margin.nil? json_array["rightMargin"] = @right_margin unless @right_margin.nil? json_array["pageWidth"] = @page_width unless @page_width.nil? json_array["pageHeight"] = @page_height unless @page_height.nil? #--------------------------------------------------- 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 |