Class: WalmartApIs::RequestedDocumentSpecification
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- WalmartApIs::RequestedDocumentSpecification
- Defined in:
- lib/walmart_ap_is/models/requested_document_specification.rb
Overview
RequestedDocumentSpecification Model.
Instance Attribute Summary collapse
-
#dpi ⇒ Dpi
TODO: Write general description for this method.
-
#format ⇒ Format1
TODO: Write general description for this method.
-
#need_file_joining ⇒ TrueClass | FalseClass
TODO: Write general description for this method.
-
#page_layout ⇒ PageLayout
TODO: Write general description for this method.
-
#print_options ⇒ Array[Object]
Optional list of additional print specs (customs forms, invoice attachments, etc).
-
#size ⇒ Size
TODO: Write general description for this method.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(format:, size:, dpi:, page_layout: SKIP, need_file_joining: SKIP, print_options: SKIP, additional_properties: nil) ⇒ RequestedDocumentSpecification
constructor
A new instance of RequestedDocumentSpecification.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(format:, size:, dpi:, page_layout: SKIP, need_file_joining: SKIP, print_options: SKIP, additional_properties: nil) ⇒ RequestedDocumentSpecification
Returns a new instance of RequestedDocumentSpecification.
63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/walmart_ap_is/models/requested_document_specification.rb', line 63 def initialize(format:, size:, dpi:, page_layout: SKIP, need_file_joining: SKIP, print_options: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @format = format @size = size @dpi = dpi @page_layout = page_layout unless page_layout == SKIP @need_file_joining = need_file_joining unless need_file_joining == SKIP @print_options = unless == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#dpi ⇒ Dpi
TODO: Write general description for this method
22 23 24 |
# File 'lib/walmart_ap_is/models/requested_document_specification.rb', line 22 def dpi @dpi end |
#format ⇒ Format1
TODO: Write general description for this method
14 15 16 |
# File 'lib/walmart_ap_is/models/requested_document_specification.rb', line 14 def format @format end |
#need_file_joining ⇒ TrueClass | FalseClass
TODO: Write general description for this method
30 31 32 |
# File 'lib/walmart_ap_is/models/requested_document_specification.rb', line 30 def need_file_joining @need_file_joining end |
#page_layout ⇒ PageLayout
TODO: Write general description for this method
26 27 28 |
# File 'lib/walmart_ap_is/models/requested_document_specification.rb', line 26 def page_layout @page_layout end |
#print_options ⇒ Array[Object]
Optional list of additional print specs (customs forms, invoice attachments, etc). Compressed; see TODO.
35 36 37 |
# File 'lib/walmart_ap_is/models/requested_document_specification.rb', line 35 def @print_options end |
#size ⇒ Size
TODO: Write general description for this method
18 19 20 |
# File 'lib/walmart_ap_is/models/requested_document_specification.rb', line 18 def size @size end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 |
# File 'lib/walmart_ap_is/models/requested_document_specification.rb', line 79 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. format = hash.key?('format') ? hash['format'] : nil size = Size.from_hash(hash['size']) if hash['size'] dpi = hash.key?('dpi') ? hash['dpi'] : nil page_layout = hash.key?('pageLayout') ? hash['pageLayout'] : SKIP need_file_joining = hash.key?('needFileJoining') ? hash['needFileJoining'] : SKIP = hash.key?('printOptions') ? hash['printOptions'] : SKIP # Create a new hash for additional properties, removing known properties. new_hash = hash.reject { |k, _| names.value?(k) } additional_properties = APIHelper.get_additional_properties( new_hash, proc { |value| value } ) # Create object from extracted values. RequestedDocumentSpecification.new(format: format, size: size, dpi: dpi, page_layout: page_layout, need_file_joining: need_file_joining, print_options: , additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
38 39 40 41 42 43 44 45 46 47 |
# File 'lib/walmart_ap_is/models/requested_document_specification.rb', line 38 def self.names @_hash = {} if @_hash.nil? @_hash['format'] = 'format' @_hash['size'] = 'size' @_hash['dpi'] = 'dpi' @_hash['page_layout'] = 'pageLayout' @_hash['need_file_joining'] = 'needFileJoining' @_hash['print_options'] = 'printOptions' @_hash end |
.nullables ⇒ Object
An array for nullable fields
59 60 61 |
# File 'lib/walmart_ap_is/models/requested_document_specification.rb', line 59 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
50 51 52 53 54 55 56 |
# File 'lib/walmart_ap_is/models/requested_document_specification.rb', line 50 def self.optionals %w[ page_layout need_file_joining print_options ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
117 118 119 120 121 122 123 |
# File 'lib/walmart_ap_is/models/requested_document_specification.rb', line 117 def inspect class_name = self.class.name.split('::').last "<#{class_name} format: #{@format.inspect}, size: #{@size.inspect}, dpi: #{@dpi.inspect},"\ " page_layout: #{@page_layout.inspect}, need_file_joining: #{@need_file_joining.inspect},"\ " print_options: #{@print_options.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
109 110 111 112 113 114 |
# File 'lib/walmart_ap_is/models/requested_document_specification.rb', line 109 def to_s class_name = self.class.name.split('::').last "<#{class_name} format: #{@format}, size: #{@size}, dpi: #{@dpi}, page_layout:"\ " #{@page_layout}, need_file_joining: #{@need_file_joining}, print_options:"\ " #{@print_options}, additional_properties: #{@additional_properties}>" end |