Class: FdxV660Api::CardArtEntity2
- Defined in:
- lib/fdx_v660_api/models/card_art_entity2.rb
Overview
Any art associated to the card related to the account
Instance Attribute Summary collapse
-
#image_uri ⇒ String
The URI link of a PNG, JPG or GIF image with proportions defined by ISO 8710 ID-1 with 340x210 ratio and width no greater than 512 pixels.
-
#label ⇒ String
Display label for the specific image.
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.
-
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
Instance Method Summary collapse
-
#initialize(label: SKIP, image_uri: SKIP, additional_properties: nil) ⇒ CardArtEntity2
constructor
A new instance of CardArtEntity2.
-
#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(label: SKIP, image_uri: SKIP, additional_properties: nil) ⇒ CardArtEntity2
Returns a new instance of CardArtEntity2.
47 48 49 50 51 52 53 54 |
# File 'lib/fdx_v660_api/models/card_art_entity2.rb', line 47 def initialize(label: SKIP, image_uri: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @label = label unless label == SKIP @image_uri = image_uri unless image_uri == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#image_uri ⇒ String
The URI link of a PNG, JPG or GIF image with proportions defined by ISO 8710 ID-1 with 340x210 ratio and width no greater than 512 pixels. The image at this URI must be accessible at all times, with no additional authentication headers. Typically this is an image resource located in the data provider's public web site or Content Delivery Network
24 25 26 |
# File 'lib/fdx_v660_api/models/card_art_entity2.rb', line 24 def image_uri @image_uri end |
#label ⇒ String
Display label for the specific image
14 15 16 |
# File 'lib/fdx_v660_api/models/card_art_entity2.rb', line 14 def label @label end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/fdx_v660_api/models/card_art_entity2.rb', line 57 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. label = hash.key?('label') ? hash['label'] : SKIP image_uri = hash.key?('imageUri') ? hash['imageUri'] : 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. CardArtEntity2.new(label: label, image_uri: image_uri, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
27 28 29 30 31 32 |
# File 'lib/fdx_v660_api/models/card_art_entity2.rb', line 27 def self.names @_hash = {} if @_hash.nil? @_hash['label'] = 'label' @_hash['image_uri'] = 'imageUri' @_hash end |
.nullables ⇒ Object
An array for nullable fields
43 44 45 |
# File 'lib/fdx_v660_api/models/card_art_entity2.rb', line 43 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
35 36 37 38 39 40 |
# File 'lib/fdx_v660_api/models/card_art_entity2.rb', line 35 def self.optionals %w[ label image_uri ] end |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
79 80 81 82 83 84 85 |
# File 'lib/fdx_v660_api/models/card_art_entity2.rb', line 79 def self.validate(value) return true if value.instance_of? self return false unless value.instance_of? Hash true end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
95 96 97 98 99 |
# File 'lib/fdx_v660_api/models/card_art_entity2.rb', line 95 def inspect class_name = self.class.name.split('::').last "<#{class_name} label: #{@label.inspect}, image_uri: #{@image_uri.inspect},"\ " additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
88 89 90 91 92 |
# File 'lib/fdx_v660_api/models/card_art_entity2.rb', line 88 def to_s class_name = self.class.name.split('::').last "<#{class_name} label: #{@label}, image_uri: #{@image_uri}, additional_properties:"\ " #{@additional_properties}>" end |