Class: VisaAcceptanceMergedSpec::Color
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- VisaAcceptanceMergedSpec::Color
- Defined in:
- lib/visa_acceptance_merged_spec/models/color.rb
Overview
Color Model.
Instance Attribute Summary collapse
-
#border ⇒ String
Border Color.
-
#border_selected ⇒ String
Selected Border Color.
-
#button ⇒ String
Button Color.
-
#button_text ⇒ String
Button Text Color.
-
#checkbox ⇒ String
Checkbox Color.
-
#checkbox_check_mark ⇒ String
Checkbox Checkmark Color.
-
#header ⇒ String
Header Color.
-
#link ⇒ String
Link Color.
-
#text ⇒ String
Text Color.
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(border: SKIP, border_selected: SKIP, button: SKIP, button_text: SKIP, checkbox: SKIP, checkbox_check_mark: SKIP, header: SKIP, link: SKIP, text: SKIP, additional_properties: nil) ⇒ Color
constructor
A new instance of Color.
-
#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(border: SKIP, border_selected: SKIP, button: SKIP, button_text: SKIP, checkbox: SKIP, checkbox_check_mark: SKIP, header: SKIP, link: SKIP, text: SKIP, additional_properties: nil) ⇒ Color
Returns a new instance of Color.
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
# File 'lib/visa_acceptance_merged_spec/models/color.rb', line 83 def initialize(border: SKIP, border_selected: SKIP, button: SKIP, button_text: SKIP, checkbox: SKIP, checkbox_check_mark: SKIP, header: SKIP, link: SKIP, text: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @border = border unless border == SKIP @border_selected = border_selected unless border_selected == SKIP @button = unless == SKIP @button_text = unless == SKIP @checkbox = checkbox unless checkbox == SKIP @checkbox_check_mark = checkbox_check_mark unless checkbox_check_mark == SKIP @header = header unless header == SKIP @link = link unless link == SKIP @text = text unless text == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#border ⇒ String
Border Color
14 15 16 |
# File 'lib/visa_acceptance_merged_spec/models/color.rb', line 14 def border @border end |
#border_selected ⇒ String
Selected Border Color
18 19 20 |
# File 'lib/visa_acceptance_merged_spec/models/color.rb', line 18 def border_selected @border_selected end |
#button ⇒ String
Button Color
22 23 24 |
# File 'lib/visa_acceptance_merged_spec/models/color.rb', line 22 def @button end |
#button_text ⇒ String
Button Text Color
26 27 28 |
# File 'lib/visa_acceptance_merged_spec/models/color.rb', line 26 def @button_text end |
#checkbox ⇒ String
Checkbox Color
30 31 32 |
# File 'lib/visa_acceptance_merged_spec/models/color.rb', line 30 def checkbox @checkbox end |
#checkbox_check_mark ⇒ String
Checkbox Checkmark Color
34 35 36 |
# File 'lib/visa_acceptance_merged_spec/models/color.rb', line 34 def checkbox_check_mark @checkbox_check_mark end |
#header ⇒ String
Header Color
38 39 40 |
# File 'lib/visa_acceptance_merged_spec/models/color.rb', line 38 def header @header end |
#link ⇒ String
Link Color
42 43 44 |
# File 'lib/visa_acceptance_merged_spec/models/color.rb', line 42 def link @link end |
#text ⇒ String
Text Color
46 47 48 |
# File 'lib/visa_acceptance_merged_spec/models/color.rb', line 46 def text @text end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 |
# File 'lib/visa_acceptance_merged_spec/models/color.rb', line 103 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. border = hash.key?('border') ? hash['border'] : SKIP border_selected = hash.key?('borderSelected') ? hash['borderSelected'] : SKIP = hash.key?('button') ? hash['button'] : SKIP = hash.key?('buttonText') ? hash['buttonText'] : SKIP checkbox = hash.key?('checkbox') ? hash['checkbox'] : SKIP checkbox_check_mark = hash.key?('checkboxCheckMark') ? hash['checkboxCheckMark'] : SKIP header = hash.key?('header') ? hash['header'] : SKIP link = hash.key?('link') ? hash['link'] : SKIP text = hash.key?('text') ? hash['text'] : 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. Color.new(border: border, border_selected: border_selected, button: , button_text: , checkbox: checkbox, checkbox_check_mark: checkbox_check_mark, header: header, link: link, text: text, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/visa_acceptance_merged_spec/models/color.rb', line 49 def self.names @_hash = {} if @_hash.nil? @_hash['border'] = 'border' @_hash['border_selected'] = 'borderSelected' @_hash['button'] = 'button' @_hash['button_text'] = 'buttonText' @_hash['checkbox'] = 'checkbox' @_hash['checkbox_check_mark'] = 'checkboxCheckMark' @_hash['header'] = 'header' @_hash['link'] = 'link' @_hash['text'] = 'text' @_hash end |
.nullables ⇒ Object
An array for nullable fields
79 80 81 |
# File 'lib/visa_acceptance_merged_spec/models/color.rb', line 79 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
64 65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/visa_acceptance_merged_spec/models/color.rb', line 64 def self.optionals %w[ border border_selected button button_text checkbox checkbox_check_mark header link text ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
149 150 151 152 153 154 155 156 |
# File 'lib/visa_acceptance_merged_spec/models/color.rb', line 149 def inspect class_name = self.class.name.split('::').last "<#{class_name} border: #{@border.inspect}, border_selected: #{@border_selected.inspect},"\ " button: #{@button.inspect}, button_text: #{@button_text.inspect}, checkbox:"\ " #{@checkbox.inspect}, checkbox_check_mark: #{@checkbox_check_mark.inspect}, header:"\ " #{@header.inspect}, link: #{@link.inspect}, text: #{@text.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
140 141 142 143 144 145 146 |
# File 'lib/visa_acceptance_merged_spec/models/color.rb', line 140 def to_s class_name = self.class.name.split('::').last "<#{class_name} border: #{@border}, border_selected: #{@border_selected}, button:"\ " #{@button}, button_text: #{@button_text}, checkbox: #{@checkbox}, checkbox_check_mark:"\ " #{@checkbox_check_mark}, header: #{@header}, link: #{@link}, text: #{@text},"\ " additional_properties: #{@additional_properties}>" end |