Class: DynamicPDFApi::WordInput
- Inherits:
-
ConverterInput
- Object
- Input
- ConverterInput
- DynamicPDFApi::WordInput
- Defined in:
- lib/ruby_client/WordInput.rb
Overview
Represents a Word input.
Instance Attribute Summary collapse
-
#text_replace ⇒ Object
Gets or sets the TextReplace object List.
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
- #GetTextReplace ⇒ Object
-
#initialize(resource, size = nil, orientation = nil, margins = nil) ⇒ WordInput
constructor
Initializes a new instance of the WordInput“/> class.
- #to_json(_options = {}) ⇒ Object
Methods inherited from ConverterInput
#page_orientation=, #page_size=
Methods inherited from Input
Constructor Details
#initialize(resource, size = nil, orientation = nil, margins = nil) ⇒ WordInput
Initializes a new instance of the WordInput“/> class.
17 18 19 20 21 22 |
# File 'lib/ruby_client/WordInput.rb', line 17 def initialize(resource, size = nil, orientation = nil, margins = nil) super(resource, size, orientation, margins) @_type = InputType::WORD @text_replace = Array.new end |
Instance Attribute Details
#text_replace ⇒ Object
Gets or sets the TextReplace object List.
35 36 37 |
# File 'lib/ruby_client/WordInput.rb', line 35 def text_replace @text_replace end |
Instance Method Details
#GetTextReplace ⇒ Object
24 25 26 27 28 29 30 |
# File 'lib/ruby_client/WordInput.rb', line 24 def GetTextReplace if ((@text_replace != nil && @text_replace.Count > 0)) @text_replace else nil end end |
#to_json(_options = {}) ⇒ Object
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/ruby_client/WordInput.rb', line 37 def to_json( = {}) json_array = {} json_array["type"] = "word" 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["textReplace"] = @text_replace unless @text_replace.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 |