Class: GroupDocsViewerCloud::HtmlOptions
- Inherits:
-
Object
- Object
- GroupDocsViewerCloud::HtmlOptions
- Defined in:
- lib/groupdocs_viewer_cloud/models/html_options.rb
Overview
Options for rendering document into HTML
Instance Attribute Summary collapse
-
#archive_options ⇒ Object
Rendering options for Archive source file formats.
-
#cad_options ⇒ Object
Rendering options for CAD source file formats CAD file formats include files with extensions: .dwg, .dxf, .dgn, .ifc, .stl.
-
#count_pages_to_render ⇒ Object
Count pages which should be rendered.
-
#default_encoding ⇒ Object
Default encoding for the plain text files such as .csv, .txt and .eml files when encoding is not specified in header.
-
#default_font_name ⇒ Object
Default font name may be specified in following cases: - You want to generally specify the default font to fall back on, if particular font in the document cannot be found during rendering.
-
#detect_encoding ⇒ Object
This option enables TXT, TSV, and CSV files encoding detection.
-
#email_options ⇒ Object
Rendering options for Email source file formats Email file formats include files with extensions: .msg, .eml, .emlx, .ifc, .stl.
-
#exclude_fonts ⇒ Object
When enabled prevents adding any fonts into HTML document.
-
#external_resources ⇒ Object
Controls output HTML document resources (styles, images and fonts) linking.
-
#fonts_to_exclude ⇒ Object
This option is supported for presentations only.
-
#for_printing ⇒ Object
Indicates whether to optimize output HTML for printing.
-
#image_height ⇒ Object
The height of an output image in pixels.
-
#image_max_height ⇒ Object
Max height of an output image in pixels.
-
#image_max_width ⇒ Object
Max width of an output image in pixels.
-
#image_width ⇒ Object
The width of the output image in pixels.
-
#is_responsive ⇒ Object
Indicates whether rendering will provide responsive web pages, that look well on different device types.
-
#mail_storage_options ⇒ Object
Rendering options for Mail storage (Lotus Notes, MBox) data files.
-
#minify ⇒ Object
Enables HTML content and HTML resources minification.
-
#outlook_options ⇒ Object
Rendering options for Outlook source file formats.
-
#page_rotations ⇒ Object
Page rotations.
-
#pages_to_render ⇒ Object
Pages list to render.
-
#pdf_document_options ⇒ Object
Rendering options for PDF source file formats.
-
#project_management_options ⇒ Object
Rendering options for MS Project source file formats Project file formats include files with extensions: .mpt, .mpp.
-
#render_comments ⇒ Object
When enabled comments will be rendered to the output.
-
#render_hidden_pages ⇒ Object
When enabled hidden pages, sheets or slides will be rendered to the output.
-
#render_notes ⇒ Object
When enabled notes will be rendered to the output.
-
#render_to_single_page ⇒ Object
Enables HTML content will be rendered to single page.
-
#resource_path ⇒ Object
Path for the HTML resources (styles, images and fonts).
-
#spreadsheet_options ⇒ Object
Rendering options for Spreadsheet source file formats Spreadsheet file formats include files with extensions: .xls, .xlsx, .xlsm, .xlsb, .csv, .ods, .ots, .xltx, .xltm, .tsv.
-
#start_page_number ⇒ Object
Page number from which rendering should be started.
-
#text_options ⇒ Object
Rendering options for Text source file formats.
-
#visio_rendering_options ⇒ Object
Rendering options for Visio source file formats.
-
#web_document_options ⇒ Object
This rendering options enables you to customize the appearance of the output HTML/PDF/PNG/JPEG when rendering Web documents.
-
#word_processing_options ⇒ Object
Rendering options for WordProcessing source file formats.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.swagger_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(other) ⇒ Object
Checks equality by comparing each attribute.
-
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type.
-
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(other) ⇒ Boolean
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ HtmlOptions
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility).
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
-
#uncap(str) ⇒ Object
Downcases first letter.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Constructor Details
#initialize(attributes = {}) ⇒ HtmlOptions
Initializes the object
218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 |
# File 'lib/groupdocs_viewer_cloud/models/html_options.rb', line 218 def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } if attributes.key?(:'StartPageNumber') self.start_page_number = attributes[:'StartPageNumber'] end if attributes.key?(:'CountPagesToRender') self.count_pages_to_render = attributes[:'CountPagesToRender'] end if attributes.key?(:'PagesToRender') if (value = attributes[:'PagesToRender']).is_a?(Array) self.pages_to_render = value end end if attributes.key?(:'PageRotations') if (value = attributes[:'PageRotations']).is_a?(Array) self.page_rotations = value end end if attributes.key?(:'DefaultFontName') self.default_font_name = attributes[:'DefaultFontName'] end if attributes.key?(:'DefaultEncoding') self.default_encoding = attributes[:'DefaultEncoding'] end if attributes.key?(:'DetectEncoding') self.detect_encoding = attributes[:'DetectEncoding'] end if attributes.key?(:'RenderComments') self.render_comments = attributes[:'RenderComments'] end if attributes.key?(:'RenderNotes') self.render_notes = attributes[:'RenderNotes'] end if attributes.key?(:'RenderHiddenPages') self.render_hidden_pages = attributes[:'RenderHiddenPages'] end if attributes.key?(:'SpreadsheetOptions') self. = attributes[:'SpreadsheetOptions'] end if attributes.key?(:'CadOptions') self. = attributes[:'CadOptions'] end if attributes.key?(:'EmailOptions') self. = attributes[:'EmailOptions'] end if attributes.key?(:'ProjectManagementOptions') self. = attributes[:'ProjectManagementOptions'] end if attributes.key?(:'PdfDocumentOptions') self. = attributes[:'PdfDocumentOptions'] end if attributes.key?(:'WordProcessingOptions') self. = attributes[:'WordProcessingOptions'] end if attributes.key?(:'OutlookOptions') self. = attributes[:'OutlookOptions'] end if attributes.key?(:'ArchiveOptions') self. = attributes[:'ArchiveOptions'] end if attributes.key?(:'TextOptions') self. = attributes[:'TextOptions'] end if attributes.key?(:'MailStorageOptions') self. = attributes[:'MailStorageOptions'] end if attributes.key?(:'VisioRenderingOptions') self. = attributes[:'VisioRenderingOptions'] end if attributes.key?(:'WebDocumentOptions') self. = attributes[:'WebDocumentOptions'] end if attributes.key?(:'ExternalResources') self.external_resources = attributes[:'ExternalResources'] end if attributes.key?(:'ResourcePath') self.resource_path = attributes[:'ResourcePath'] end if attributes.key?(:'IsResponsive') self.is_responsive = attributes[:'IsResponsive'] end if attributes.key?(:'Minify') self.minify = attributes[:'Minify'] end if attributes.key?(:'ExcludeFonts') self.exclude_fonts = attributes[:'ExcludeFonts'] end if attributes.key?(:'FontsToExclude') if (value = attributes[:'FontsToExclude']).is_a?(Array) self.fonts_to_exclude = value end end if attributes.key?(:'ForPrinting') self.for_printing = attributes[:'ForPrinting'] end if attributes.key?(:'ImageHeight') self.image_height = attributes[:'ImageHeight'] end if attributes.key?(:'ImageWidth') self.image_width = attributes[:'ImageWidth'] end if attributes.key?(:'ImageMaxHeight') self.image_max_height = attributes[:'ImageMaxHeight'] end if attributes.key?(:'ImageMaxWidth') self.image_max_width = attributes[:'ImageMaxWidth'] end if attributes.key?(:'RenderToSinglePage') self.render_to_single_page = attributes[:'RenderToSinglePage'] end end |
Instance Attribute Details
#archive_options ⇒ Object
Rendering options for Archive source file formats
86 87 88 |
# File 'lib/groupdocs_viewer_cloud/models/html_options.rb', line 86 def @archive_options end |
#cad_options ⇒ Object
Rendering options for CAD source file formats CAD file formats include files with extensions: .dwg, .dxf, .dgn, .ifc, .stl
68 69 70 |
# File 'lib/groupdocs_viewer_cloud/models/html_options.rb', line 68 def @cad_options end |
#count_pages_to_render ⇒ Object
Count pages which should be rendered
38 39 40 |
# File 'lib/groupdocs_viewer_cloud/models/html_options.rb', line 38 def count_pages_to_render @count_pages_to_render end |
#default_encoding ⇒ Object
Default encoding for the plain text files such as .csv, .txt and .eml files when encoding is not specified in header
50 51 52 |
# File 'lib/groupdocs_viewer_cloud/models/html_options.rb', line 50 def default_encoding @default_encoding end |
#default_font_name ⇒ Object
Default font name may be specified in following cases: - You want to generally specify the default font to fall back on, if particular font in the document cannot be found during rendering. - Your document uses fonts, that contain non-English characters and you want to make sure any missing font is replaced with one that has the same character set available.
47 48 49 |
# File 'lib/groupdocs_viewer_cloud/models/html_options.rb', line 47 def default_font_name @default_font_name end |
#detect_encoding ⇒ Object
This option enables TXT, TSV, and CSV files encoding detection. In case the encoding can’t be detected the DefaultEncoding is used.
53 54 55 |
# File 'lib/groupdocs_viewer_cloud/models/html_options.rb', line 53 def detect_encoding @detect_encoding end |
#email_options ⇒ Object
Rendering options for Email source file formats Email file formats include files with extensions: .msg, .eml, .emlx, .ifc, .stl
71 72 73 |
# File 'lib/groupdocs_viewer_cloud/models/html_options.rb', line 71 def @email_options end |
#exclude_fonts ⇒ Object
When enabled prevents adding any fonts into HTML document
113 114 115 |
# File 'lib/groupdocs_viewer_cloud/models/html_options.rb', line 113 def exclude_fonts @exclude_fonts end |
#external_resources ⇒ Object
Controls output HTML document resources (styles, images and fonts) linking. By default this option is disabled and all the resources are embedded into HTML document.
101 102 103 |
# File 'lib/groupdocs_viewer_cloud/models/html_options.rb', line 101 def external_resources @external_resources end |
#fonts_to_exclude ⇒ Object
This option is supported for presentations only. The list of font names, to exclude from HTML document
116 117 118 |
# File 'lib/groupdocs_viewer_cloud/models/html_options.rb', line 116 def fonts_to_exclude @fonts_to_exclude end |
#for_printing ⇒ Object
Indicates whether to optimize output HTML for printing.
119 120 121 |
# File 'lib/groupdocs_viewer_cloud/models/html_options.rb', line 119 def for_printing @for_printing end |
#image_height ⇒ Object
The height of an output image in pixels. (When converting single image to HTML only)
122 123 124 |
# File 'lib/groupdocs_viewer_cloud/models/html_options.rb', line 122 def image_height @image_height end |
#image_max_height ⇒ Object
Max height of an output image in pixels. (When converting single image to HTML only)
128 129 130 |
# File 'lib/groupdocs_viewer_cloud/models/html_options.rb', line 128 def image_max_height @image_max_height end |
#image_max_width ⇒ Object
Max width of an output image in pixels. (When converting single image to HTML only)
131 132 133 |
# File 'lib/groupdocs_viewer_cloud/models/html_options.rb', line 131 def image_max_width @image_max_width end |
#image_width ⇒ Object
The width of the output image in pixels. (When converting single image to HTML only)
125 126 127 |
# File 'lib/groupdocs_viewer_cloud/models/html_options.rb', line 125 def image_width @image_width end |
#is_responsive ⇒ Object
Indicates whether rendering will provide responsive web pages, that look well on different device types. Default value is false.
107 108 109 |
# File 'lib/groupdocs_viewer_cloud/models/html_options.rb', line 107 def is_responsive @is_responsive end |
#mail_storage_options ⇒ Object
Rendering options for Mail storage (Lotus Notes, MBox) data files.
92 93 94 |
# File 'lib/groupdocs_viewer_cloud/models/html_options.rb', line 92 def @mail_storage_options end |
#minify ⇒ Object
Enables HTML content and HTML resources minification
110 111 112 |
# File 'lib/groupdocs_viewer_cloud/models/html_options.rb', line 110 def minify @minify end |
#outlook_options ⇒ Object
Rendering options for Outlook source file formats
83 84 85 |
# File 'lib/groupdocs_viewer_cloud/models/html_options.rb', line 83 def @outlook_options end |
#page_rotations ⇒ Object
Page rotations
44 45 46 |
# File 'lib/groupdocs_viewer_cloud/models/html_options.rb', line 44 def page_rotations @page_rotations end |
#pages_to_render ⇒ Object
Pages list to render. Ignored, if StartPageNumber and CountPagesToRender are provided
41 42 43 |
# File 'lib/groupdocs_viewer_cloud/models/html_options.rb', line 41 def pages_to_render @pages_to_render end |
#pdf_document_options ⇒ Object
Rendering options for PDF source file formats
77 78 79 |
# File 'lib/groupdocs_viewer_cloud/models/html_options.rb', line 77 def @pdf_document_options end |
#project_management_options ⇒ Object
Rendering options for MS Project source file formats Project file formats include files with extensions: .mpt, .mpp
74 75 76 |
# File 'lib/groupdocs_viewer_cloud/models/html_options.rb', line 74 def @project_management_options end |
#render_comments ⇒ Object
When enabled comments will be rendered to the output
56 57 58 |
# File 'lib/groupdocs_viewer_cloud/models/html_options.rb', line 56 def render_comments @render_comments end |
#render_hidden_pages ⇒ Object
When enabled hidden pages, sheets or slides will be rendered to the output
62 63 64 |
# File 'lib/groupdocs_viewer_cloud/models/html_options.rb', line 62 def render_hidden_pages @render_hidden_pages end |
#render_notes ⇒ Object
When enabled notes will be rendered to the output
59 60 61 |
# File 'lib/groupdocs_viewer_cloud/models/html_options.rb', line 59 def render_notes @render_notes end |
#render_to_single_page ⇒ Object
Enables HTML content will be rendered to single page
134 135 136 |
# File 'lib/groupdocs_viewer_cloud/models/html_options.rb', line 134 def render_to_single_page @render_to_single_page end |
#resource_path ⇒ Object
Path for the HTML resources (styles, images and fonts). For example when resource path is example.com/api/pages/page-number/resources/resource-name the page-number and resource-name templates will be replaced with page number and resource name accordingly. This option is ignored when ExternalResources option is disabled.
104 105 106 |
# File 'lib/groupdocs_viewer_cloud/models/html_options.rb', line 104 def resource_path @resource_path end |
#spreadsheet_options ⇒ Object
Rendering options for Spreadsheet source file formats Spreadsheet file formats include files with extensions: .xls, .xlsx, .xlsm, .xlsb, .csv, .ods, .ots, .xltx, .xltm, .tsv
65 66 67 |
# File 'lib/groupdocs_viewer_cloud/models/html_options.rb', line 65 def @spreadsheet_options end |
#start_page_number ⇒ Object
Page number from which rendering should be started
35 36 37 |
# File 'lib/groupdocs_viewer_cloud/models/html_options.rb', line 35 def start_page_number @start_page_number end |
#text_options ⇒ Object
Rendering options for Text source file formats
89 90 91 |
# File 'lib/groupdocs_viewer_cloud/models/html_options.rb', line 89 def @text_options end |
#visio_rendering_options ⇒ Object
Rendering options for Visio source file formats
95 96 97 |
# File 'lib/groupdocs_viewer_cloud/models/html_options.rb', line 95 def @visio_rendering_options end |
#web_document_options ⇒ Object
This rendering options enables you to customize the appearance of the output HTML/PDF/PNG/JPEG when rendering Web documents.
98 99 100 |
# File 'lib/groupdocs_viewer_cloud/models/html_options.rb', line 98 def @web_document_options end |
#word_processing_options ⇒ Object
Rendering options for WordProcessing source file formats
80 81 82 |
# File 'lib/groupdocs_viewer_cloud/models/html_options.rb', line 80 def @word_processing_options end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 |
# File 'lib/groupdocs_viewer_cloud/models/html_options.rb', line 137 def self.attribute_map { :'start_page_number' => :'StartPageNumber', :'count_pages_to_render' => :'CountPagesToRender', :'pages_to_render' => :'PagesToRender', :'page_rotations' => :'PageRotations', :'default_font_name' => :'DefaultFontName', :'default_encoding' => :'DefaultEncoding', :'detect_encoding' => :'DetectEncoding', :'render_comments' => :'RenderComments', :'render_notes' => :'RenderNotes', :'render_hidden_pages' => :'RenderHiddenPages', :'spreadsheet_options' => :'SpreadsheetOptions', :'cad_options' => :'CadOptions', :'email_options' => :'EmailOptions', :'project_management_options' => :'ProjectManagementOptions', :'pdf_document_options' => :'PdfDocumentOptions', :'word_processing_options' => :'WordProcessingOptions', :'outlook_options' => :'OutlookOptions', :'archive_options' => :'ArchiveOptions', :'text_options' => :'TextOptions', :'mail_storage_options' => :'MailStorageOptions', :'visio_rendering_options' => :'VisioRenderingOptions', :'web_document_options' => :'WebDocumentOptions', :'external_resources' => :'ExternalResources', :'resource_path' => :'ResourcePath', :'is_responsive' => :'IsResponsive', :'minify' => :'Minify', :'exclude_fonts' => :'ExcludeFonts', :'fonts_to_exclude' => :'FontsToExclude', :'for_printing' => :'ForPrinting', :'image_height' => :'ImageHeight', :'image_width' => :'ImageWidth', :'image_max_height' => :'ImageMaxHeight', :'image_max_width' => :'ImageMaxWidth', :'render_to_single_page' => :'RenderToSinglePage' } end |
.swagger_types ⇒ Object
Attribute type mapping.
177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 |
# File 'lib/groupdocs_viewer_cloud/models/html_options.rb', line 177 def self.swagger_types { :'start_page_number' => :'Integer', :'count_pages_to_render' => :'Integer', :'pages_to_render' => :'Array<Integer>', :'page_rotations' => :'Array<PageRotation>', :'default_font_name' => :'String', :'default_encoding' => :'String', :'detect_encoding' => :'BOOLEAN', :'render_comments' => :'BOOLEAN', :'render_notes' => :'BOOLEAN', :'render_hidden_pages' => :'BOOLEAN', :'spreadsheet_options' => :'SpreadsheetOptions', :'cad_options' => :'CadOptions', :'email_options' => :'EmailOptions', :'project_management_options' => :'ProjectManagementOptions', :'pdf_document_options' => :'PdfDocumentOptions', :'word_processing_options' => :'WordProcessingOptions', :'outlook_options' => :'OutlookOptions', :'archive_options' => :'ArchiveOptions', :'text_options' => :'TextOptions', :'mail_storage_options' => :'MailStorageOptions', :'visio_rendering_options' => :'VisioRenderingOptions', :'web_document_options' => :'WebDocumentOptions', :'external_resources' => :'BOOLEAN', :'resource_path' => :'String', :'is_responsive' => :'BOOLEAN', :'minify' => :'BOOLEAN', :'exclude_fonts' => :'BOOLEAN', :'fonts_to_exclude' => :'Array<String>', :'for_printing' => :'BOOLEAN', :'image_height' => :'Integer', :'image_width' => :'Integer', :'image_max_height' => :'Integer', :'image_max_width' => :'Integer', :'render_to_single_page' => :'BOOLEAN' } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 |
# File 'lib/groupdocs_viewer_cloud/models/html_options.rb', line 458 def ==(other) return true if self.equal?(other) self.class == other.class && start_page_number == other.start_page_number && count_pages_to_render == other.count_pages_to_render && pages_to_render == other.pages_to_render && page_rotations == other.page_rotations && default_font_name == other.default_font_name && default_encoding == other.default_encoding && detect_encoding == other.detect_encoding && render_comments == other.render_comments && render_notes == other.render_notes && render_hidden_pages == other.render_hidden_pages && == other. && == other. && == other. && == other. && == other. && == other. && == other. && == other. && == other. && == other. && == other. && == other. && external_resources == other.external_resources && resource_path == other.resource_path && is_responsive == other.is_responsive && minify == other.minify && exclude_fonts == other.exclude_fonts && fonts_to_exclude == other.fonts_to_exclude && for_printing == other.for_printing && image_height == other.image_height && image_width == other.image_width && image_max_height == other.image_max_height && image_max_width == other.image_max_width && render_to_single_page == other.render_to_single_page end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 |
# File 'lib/groupdocs_viewer_cloud/models/html_options.rb', line 542 def _deserialize(type, value) case type.to_sym when :DateTime Date.parse value when :Date Date.parse value when :String value.to_s when :Integer value.to_i when :Float value.to_f when :BOOLEAN if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else false end when :Object # generic object (usually a Hash), return directly value when /\AArray<(?<inner_type>.+)>\z/ inner_type = Regexp.last_match[:inner_type] value.map { |v| _deserialize(inner_type, v) } when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/ k_type = Regexp.last_match[:k_type] v_type = Regexp.last_match[:v_type] {}.tap do |hash| value.each do |k, v| hash[_deserialize(k_type, k)] = _deserialize(v_type, v) end end else # model temp_model = GroupDocsViewerCloud.const_get(type).new temp_model.build_from_hash(value) end end |
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value
609 610 611 612 613 614 615 616 617 618 619 620 621 |
# File 'lib/groupdocs_viewer_cloud/models/html_options.rb', line 609 def _to_hash(value) if value.is_a?(Array) value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } end elsif value.respond_to? :to_hash value.to_hash else value end end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 |
# File 'lib/groupdocs_viewer_cloud/models/html_options.rb', line 518 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| pname = uncap(self.class.attribute_map[key]).intern value = attributes[pname] if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if value.is_a?(Array) self.send("#{key}=", value.map { |v| _deserialize($1, v) }) end elsif !value.nil? self.send("#{key}=", _deserialize(type, value)) end # or else data not found in attributes(hash), not an issue as the data can be optional end self end |
#eql?(other) ⇒ Boolean
499 500 501 |
# File 'lib/groupdocs_viewer_cloud/models/html_options.rb', line 499 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
505 506 507 |
# File 'lib/groupdocs_viewer_cloud/models/html_options.rb', line 505 def hash [start_page_number, count_pages_to_render, pages_to_render, page_rotations, default_font_name, default_encoding, detect_encoding, render_comments, render_notes, render_hidden_pages, , , , , , , , , , , , , external_resources, resource_path, is_responsive, minify, exclude_fonts, fonts_to_exclude, for_printing, image_height, image_width, image_max_height, image_max_width, render_to_single_page].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 |
# File 'lib/groupdocs_viewer_cloud/models/html_options.rb', line 370 def list_invalid_properties invalid_properties = [] if @start_page_number.nil? invalid_properties.push("invalid value for 'start_page_number', start_page_number cannot be nil.") end if @count_pages_to_render.nil? invalid_properties.push("invalid value for 'count_pages_to_render', count_pages_to_render cannot be nil.") end if @render_comments.nil? invalid_properties.push("invalid value for 'render_comments', render_comments cannot be nil.") end if @render_notes.nil? invalid_properties.push("invalid value for 'render_notes', render_notes cannot be nil.") end if @render_hidden_pages.nil? invalid_properties.push("invalid value for 'render_hidden_pages', render_hidden_pages cannot be nil.") end if @external_resources.nil? invalid_properties.push("invalid value for 'external_resources', external_resources cannot be nil.") end if @is_responsive.nil? invalid_properties.push("invalid value for 'is_responsive', is_responsive cannot be nil.") end if @minify.nil? invalid_properties.push("invalid value for 'minify', minify cannot be nil.") end if @exclude_fonts.nil? invalid_properties.push("invalid value for 'exclude_fonts', exclude_fonts cannot be nil.") end if @for_printing.nil? invalid_properties.push("invalid value for 'for_printing', for_printing cannot be nil.") end if @image_height.nil? invalid_properties.push("invalid value for 'image_height', image_height cannot be nil.") end if @image_width.nil? invalid_properties.push("invalid value for 'image_width', image_width cannot be nil.") end if @image_max_height.nil? invalid_properties.push("invalid value for 'image_max_height', image_max_height cannot be nil.") end if @image_max_width.nil? invalid_properties.push("invalid value for 'image_max_width', image_max_width cannot be nil.") end if @render_to_single_page.nil? invalid_properties.push("invalid value for 'render_to_single_page', render_to_single_page cannot be nil.") end return invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
589 590 591 |
# File 'lib/groupdocs_viewer_cloud/models/html_options.rb', line 589 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
595 596 597 598 599 600 601 602 603 |
# File 'lib/groupdocs_viewer_cloud/models/html_options.rb', line 595 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) next if value.nil? hash[param] = _to_hash(value) end hash end |
#to_s ⇒ String
Returns the string representation of the object
583 584 585 |
# File 'lib/groupdocs_viewer_cloud/models/html_options.rb', line 583 def to_s to_hash.to_s end |
#uncap(str) ⇒ Object
Downcases first letter.
511 512 513 |
# File 'lib/groupdocs_viewer_cloud/models/html_options.rb', line 511 def uncap(str) str[0, 1].downcase + str[1..-1] end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 |
# File 'lib/groupdocs_viewer_cloud/models/html_options.rb', line 437 def valid? return false if @start_page_number.nil? return false if @count_pages_to_render.nil? return false if @render_comments.nil? return false if @render_notes.nil? return false if @render_hidden_pages.nil? return false if @external_resources.nil? return false if @is_responsive.nil? return false if @minify.nil? return false if @exclude_fonts.nil? return false if @for_printing.nil? return false if @image_height.nil? return false if @image_width.nil? return false if @image_max_height.nil? return false if @image_max_width.nil? return false if @render_to_single_page.nil? return true end |