Class: PokeApiClient::EvolutionChainDetailChainEvolvesToInnerEvolutionDetailsInner
- Inherits:
-
ApiModelBase
- Object
- ApiModelBase
- PokeApiClient::EvolutionChainDetailChainEvolvesToInnerEvolutionDetailsInner
- Defined in:
- lib/pokeapi_client/models/evolution_chain_detail_chain_evolves_to_inner_evolution_details_inner.rb
Instance Attribute Summary collapse
-
#gender ⇒ Object
Returns the value of attribute gender.
-
#held_item ⇒ Object
Returns the value of attribute held_item.
-
#item ⇒ Object
Returns the value of attribute item.
-
#known_move ⇒ Object
Returns the value of attribute known_move.
-
#known_move_type ⇒ Object
Returns the value of attribute known_move_type.
-
#location ⇒ Object
Returns the value of attribute location.
-
#min_affection ⇒ Object
Returns the value of attribute min_affection.
-
#min_beauty ⇒ Object
Returns the value of attribute min_beauty.
-
#min_happiness ⇒ Object
Returns the value of attribute min_happiness.
-
#min_level ⇒ Object
Returns the value of attribute min_level.
-
#needs_overworld_rain ⇒ Object
Returns the value of attribute needs_overworld_rain.
-
#party_species ⇒ Object
Returns the value of attribute party_species.
-
#party_type ⇒ Object
Returns the value of attribute party_type.
-
#relative_physical_stats ⇒ Object
Returns the value of attribute relative_physical_stats.
-
#time_of_day ⇒ Object
Returns the value of attribute time_of_day.
-
#trade_species ⇒ Object
Returns the value of attribute trade_species.
-
#trigger ⇒ Object
Returns the value of attribute trigger.
-
#turn_upside_down ⇒ Object
Returns the value of attribute turn_upside_down.
Class Method Summary collapse
-
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about.
-
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about.
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.build_from_hash(attributes) ⇒ Object
Builds the object from hash.
-
.openapi_nullable ⇒ Object
List of attributes with nullable: true.
-
.openapi_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ EvolutionChainDetailChainEvolvesToInnerEvolutionDetailsInner
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Methods inherited from ApiModelBase
_deserialize, #_to_hash, #to_body, #to_s
Constructor Details
#initialize(attributes = {}) ⇒ EvolutionChainDetailChainEvolvesToInnerEvolutionDetailsInner
Initializes the object
120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 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 175 176 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 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 |
# File 'lib/pokeapi_client/models/evolution_chain_detail_chain_evolves_to_inner_evolution_details_inner.rb', line 120 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `PokeApiClient::EvolutionChainDetailChainEvolvesToInnerEvolutionDetailsInner` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) fail ArgumentError, "`#{k}` is not a valid attribute in `PokeApiClient::EvolutionChainDetailChainEvolvesToInnerEvolutionDetailsInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'gender') self.gender = attributes[:'gender'] else self.gender = nil end if attributes.key?(:'held_item') self.held_item = attributes[:'held_item'] else self.held_item = nil end if attributes.key?(:'item') self.item = attributes[:'item'] else self.item = nil end if attributes.key?(:'known_move') self.known_move = attributes[:'known_move'] else self.known_move = nil end if attributes.key?(:'known_move_type') self.known_move_type = attributes[:'known_move_type'] else self.known_move_type = nil end if attributes.key?(:'location') self.location = attributes[:'location'] else self.location = nil end if attributes.key?(:'min_affection') self.min_affection = attributes[:'min_affection'] else self.min_affection = nil end if attributes.key?(:'min_beauty') self.min_beauty = attributes[:'min_beauty'] else self.min_beauty = nil end if attributes.key?(:'min_happiness') self.min_happiness = attributes[:'min_happiness'] else self.min_happiness = nil end if attributes.key?(:'min_level') self.min_level = attributes[:'min_level'] else self.min_level = nil end if attributes.key?(:'needs_overworld_rain') self.needs_overworld_rain = attributes[:'needs_overworld_rain'] else self.needs_overworld_rain = nil end if attributes.key?(:'party_species') self.party_species = attributes[:'party_species'] else self.party_species = nil end if attributes.key?(:'party_type') self.party_type = attributes[:'party_type'] else self.party_type = nil end if attributes.key?(:'relative_physical_stats') self.relative_physical_stats = attributes[:'relative_physical_stats'] else self.relative_physical_stats = nil end if attributes.key?(:'time_of_day') self.time_of_day = attributes[:'time_of_day'] else self.time_of_day = nil end if attributes.key?(:'trade_species') self.trade_species = attributes[:'trade_species'] else self.trade_species = nil end if attributes.key?(:'trigger') self.trigger = attributes[:'trigger'] else self.trigger = nil end if attributes.key?(:'turn_upside_down') self.turn_upside_down = attributes[:'turn_upside_down'] else self.turn_upside_down = nil end end |
Instance Attribute Details
#gender ⇒ Object
Returns the value of attribute gender.
18 19 20 |
# File 'lib/pokeapi_client/models/evolution_chain_detail_chain_evolves_to_inner_evolution_details_inner.rb', line 18 def gender @gender end |
#held_item ⇒ Object
Returns the value of attribute held_item.
20 21 22 |
# File 'lib/pokeapi_client/models/evolution_chain_detail_chain_evolves_to_inner_evolution_details_inner.rb', line 20 def held_item @held_item end |
#item ⇒ Object
Returns the value of attribute item.
22 23 24 |
# File 'lib/pokeapi_client/models/evolution_chain_detail_chain_evolves_to_inner_evolution_details_inner.rb', line 22 def item @item end |
#known_move ⇒ Object
Returns the value of attribute known_move.
24 25 26 |
# File 'lib/pokeapi_client/models/evolution_chain_detail_chain_evolves_to_inner_evolution_details_inner.rb', line 24 def known_move @known_move end |
#known_move_type ⇒ Object
Returns the value of attribute known_move_type.
26 27 28 |
# File 'lib/pokeapi_client/models/evolution_chain_detail_chain_evolves_to_inner_evolution_details_inner.rb', line 26 def known_move_type @known_move_type end |
#location ⇒ Object
Returns the value of attribute location.
28 29 30 |
# File 'lib/pokeapi_client/models/evolution_chain_detail_chain_evolves_to_inner_evolution_details_inner.rb', line 28 def location @location end |
#min_affection ⇒ Object
Returns the value of attribute min_affection.
30 31 32 |
# File 'lib/pokeapi_client/models/evolution_chain_detail_chain_evolves_to_inner_evolution_details_inner.rb', line 30 def min_affection @min_affection end |
#min_beauty ⇒ Object
Returns the value of attribute min_beauty.
32 33 34 |
# File 'lib/pokeapi_client/models/evolution_chain_detail_chain_evolves_to_inner_evolution_details_inner.rb', line 32 def min_beauty @min_beauty end |
#min_happiness ⇒ Object
Returns the value of attribute min_happiness.
34 35 36 |
# File 'lib/pokeapi_client/models/evolution_chain_detail_chain_evolves_to_inner_evolution_details_inner.rb', line 34 def min_happiness @min_happiness end |
#min_level ⇒ Object
Returns the value of attribute min_level.
36 37 38 |
# File 'lib/pokeapi_client/models/evolution_chain_detail_chain_evolves_to_inner_evolution_details_inner.rb', line 36 def min_level @min_level end |
#needs_overworld_rain ⇒ Object
Returns the value of attribute needs_overworld_rain.
38 39 40 |
# File 'lib/pokeapi_client/models/evolution_chain_detail_chain_evolves_to_inner_evolution_details_inner.rb', line 38 def needs_overworld_rain @needs_overworld_rain end |
#party_species ⇒ Object
Returns the value of attribute party_species.
40 41 42 |
# File 'lib/pokeapi_client/models/evolution_chain_detail_chain_evolves_to_inner_evolution_details_inner.rb', line 40 def party_species @party_species end |
#party_type ⇒ Object
Returns the value of attribute party_type.
42 43 44 |
# File 'lib/pokeapi_client/models/evolution_chain_detail_chain_evolves_to_inner_evolution_details_inner.rb', line 42 def party_type @party_type end |
#relative_physical_stats ⇒ Object
Returns the value of attribute relative_physical_stats.
44 45 46 |
# File 'lib/pokeapi_client/models/evolution_chain_detail_chain_evolves_to_inner_evolution_details_inner.rb', line 44 def relative_physical_stats @relative_physical_stats end |
#time_of_day ⇒ Object
Returns the value of attribute time_of_day.
46 47 48 |
# File 'lib/pokeapi_client/models/evolution_chain_detail_chain_evolves_to_inner_evolution_details_inner.rb', line 46 def time_of_day @time_of_day end |
#trade_species ⇒ Object
Returns the value of attribute trade_species.
48 49 50 |
# File 'lib/pokeapi_client/models/evolution_chain_detail_chain_evolves_to_inner_evolution_details_inner.rb', line 48 def trade_species @trade_species end |
#trigger ⇒ Object
Returns the value of attribute trigger.
50 51 52 |
# File 'lib/pokeapi_client/models/evolution_chain_detail_chain_evolves_to_inner_evolution_details_inner.rb', line 50 def trigger @trigger end |
#turn_upside_down ⇒ Object
Returns the value of attribute turn_upside_down.
52 53 54 |
# File 'lib/pokeapi_client/models/evolution_chain_detail_chain_evolves_to_inner_evolution_details_inner.rb', line 52 def turn_upside_down @turn_upside_down end |
Class Method Details
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about
79 80 81 |
# File 'lib/pokeapi_client/models/evolution_chain_detail_chain_evolves_to_inner_evolution_details_inner.rb', line 79 def self.acceptable_attribute_map attribute_map end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
84 85 86 |
# File 'lib/pokeapi_client/models/evolution_chain_detail_chain_evolves_to_inner_evolution_details_inner.rb', line 84 def self.acceptable_attributes acceptable_attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/pokeapi_client/models/evolution_chain_detail_chain_evolves_to_inner_evolution_details_inner.rb', line 55 def self.attribute_map { :'gender' => :'gender', :'held_item' => :'held_item', :'item' => :'item', :'known_move' => :'known_move', :'known_move_type' => :'known_move_type', :'location' => :'location', :'min_affection' => :'min_affection', :'min_beauty' => :'min_beauty', :'min_happiness' => :'min_happiness', :'min_level' => :'min_level', :'needs_overworld_rain' => :'needs_overworld_rain', :'party_species' => :'party_species', :'party_type' => :'party_type', :'relative_physical_stats' => :'relative_physical_stats', :'time_of_day' => :'time_of_day', :'trade_species' => :'trade_species', :'trigger' => :'trigger', :'turn_upside_down' => :'turn_upside_down' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 |
# File 'lib/pokeapi_client/models/evolution_chain_detail_chain_evolves_to_inner_evolution_details_inner.rb', line 568 def self.build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) transformed_hash = {} openapi_types.each_pair do |key, type| if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[attribute_map[key]].is_a?(Array) transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end elsif !attributes[attribute_map[key]].nil? transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end new(transformed_hash) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
113 114 115 116 |
# File 'lib/pokeapi_client/models/evolution_chain_detail_chain_evolves_to_inner_evolution_details_inner.rb', line 113 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 |
# File 'lib/pokeapi_client/models/evolution_chain_detail_chain_evolves_to_inner_evolution_details_inner.rb', line 89 def self.openapi_types { :'gender' => :'EvolutionChainDetailChainEvolvesToInnerEvolutionDetailsInnerGender', :'held_item' => :'EvolutionChainDetailChainEvolvesToInnerEvolutionDetailsInnerGender', :'item' => :'EvolutionChainDetailChainEvolvesToInnerEvolutionDetailsInnerGender', :'known_move' => :'EvolutionChainDetailChainEvolvesToInnerEvolutionDetailsInnerGender', :'known_move_type' => :'EvolutionChainDetailChainEvolvesToInnerEvolutionDetailsInnerGender', :'location' => :'EvolutionChainDetailChainEvolvesToInnerEvolutionDetailsInnerGender', :'min_affection' => :'Integer', :'min_beauty' => :'Integer', :'min_happiness' => :'Integer', :'min_level' => :'Integer', :'needs_overworld_rain' => :'Boolean', :'party_species' => :'String', :'party_type' => :'String', :'relative_physical_stats' => :'String', :'time_of_day' => :'String', :'trade_species' => :'String', :'trigger' => :'AbilityDetailPokemonInnerPokemon', :'turn_upside_down' => :'Boolean' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 |
# File 'lib/pokeapi_client/models/evolution_chain_detail_chain_evolves_to_inner_evolution_details_inner.rb', line 530 def ==(o) return true if self.equal?(o) self.class == o.class && gender == o.gender && held_item == o.held_item && item == o.item && known_move == o.known_move && known_move_type == o.known_move_type && location == o.location && min_affection == o.min_affection && min_beauty == o.min_beauty && min_happiness == o.min_happiness && min_level == o.min_level && needs_overworld_rain == o.needs_overworld_rain && party_species == o.party_species && party_type == o.party_type && relative_physical_stats == o.relative_physical_stats && time_of_day == o.time_of_day && trade_species == o.trade_species && trigger == o.trigger && turn_upside_down == o.turn_upside_down end |
#eql?(o) ⇒ Boolean
555 556 557 |
# File 'lib/pokeapi_client/models/evolution_chain_detail_chain_evolves_to_inner_evolution_details_inner.rb', line 555 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
561 562 563 |
# File 'lib/pokeapi_client/models/evolution_chain_detail_chain_evolves_to_inner_evolution_details_inner.rb', line 561 def hash [gender, held_item, item, known_move, known_move_type, location, min_affection, min_beauty, min_happiness, min_level, needs_overworld_rain, party_species, party_type, relative_physical_stats, time_of_day, trade_species, trigger, turn_upside_down].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
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 |
# File 'lib/pokeapi_client/models/evolution_chain_detail_chain_evolves_to_inner_evolution_details_inner.rb', line 245 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @gender.nil? invalid_properties.push('invalid value for "gender", gender cannot be nil.') end if @held_item.nil? invalid_properties.push('invalid value for "held_item", held_item cannot be nil.') end if @item.nil? invalid_properties.push('invalid value for "item", item cannot be nil.') end if @known_move.nil? invalid_properties.push('invalid value for "known_move", known_move cannot be nil.') end if @known_move_type.nil? invalid_properties.push('invalid value for "known_move_type", known_move_type cannot be nil.') end if @location.nil? invalid_properties.push('invalid value for "location", location cannot be nil.') end if @min_affection.nil? invalid_properties.push('invalid value for "min_affection", min_affection cannot be nil.') end if @min_beauty.nil? invalid_properties.push('invalid value for "min_beauty", min_beauty cannot be nil.') end if @min_happiness.nil? invalid_properties.push('invalid value for "min_happiness", min_happiness cannot be nil.') end if @min_level.nil? invalid_properties.push('invalid value for "min_level", min_level cannot be nil.') end if @needs_overworld_rain.nil? invalid_properties.push('invalid value for "needs_overworld_rain", needs_overworld_rain cannot be nil.') end if @party_species.nil? invalid_properties.push('invalid value for "party_species", party_species cannot be nil.') end if @party_type.nil? invalid_properties.push('invalid value for "party_type", party_type cannot be nil.') end if @relative_physical_stats.nil? invalid_properties.push('invalid value for "relative_physical_stats", relative_physical_stats cannot be nil.') end if @time_of_day.nil? invalid_properties.push('invalid value for "time_of_day", time_of_day cannot be nil.') end if @trade_species.nil? invalid_properties.push('invalid value for "trade_species", trade_species cannot be nil.') end if @trigger.nil? invalid_properties.push('invalid value for "trigger", trigger cannot be nil.') end if @turn_upside_down.nil? invalid_properties.push('invalid value for "turn_upside_down", turn_upside_down cannot be nil.') end invalid_properties end |
#to_hash ⇒ Hash
Returns the object in the form of hash
590 591 592 593 594 595 596 597 598 599 600 601 602 |
# File 'lib/pokeapi_client/models/evolution_chain_detail_chain_evolves_to_inner_evolution_details_inner.rb', line 590 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) if value.nil? is_nullable = self.class.openapi_nullable.include?(attr) next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) end hash[param] = _to_hash(value) end hash end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 |
# File 'lib/pokeapi_client/models/evolution_chain_detail_chain_evolves_to_inner_evolution_details_inner.rb', line 325 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if @gender.nil? return false if @held_item.nil? return false if @item.nil? return false if @known_move.nil? return false if @known_move_type.nil? return false if @location.nil? return false if @min_affection.nil? return false if @min_beauty.nil? return false if @min_happiness.nil? return false if @min_level.nil? return false if @needs_overworld_rain.nil? return false if @party_species.nil? return false if @party_type.nil? return false if @relative_physical_stats.nil? return false if @time_of_day.nil? return false if @trade_species.nil? return false if @trigger.nil? return false if @turn_upside_down.nil? true end |