Class: Intrinio::ApiResponseSecurityQuote
- Inherits:
-
Object
- Object
- Intrinio::ApiResponseSecurityQuote
- Defined in:
- lib/intrinio-sdk/models/api_response_security_quote.rb
Overview
A realtime price quote of a security.
Instance Attribute Summary collapse
-
#adj_close_180_days_ago ⇒ Object
The adjusted close price 180 days ago.
-
#adj_close_1825_days_ago ⇒ Object
The adjusted close price 1825 days ago.
-
#adj_close_30_days_ago ⇒ Object
The adjusted close price 30 days ago.
-
#adj_close_365_days_ago ⇒ Object
The adjusted close price 365 days ago.
-
#adj_close_5_days_ago ⇒ Object
The adjusted close price 5 days ago.
-
#adj_close_730_days_ago ⇒ Object
The adjusted close price 730 days ago.
-
#adj_close_90_days_ago ⇒ Object
The adjusted close price 90 days ago.
-
#adj_close_year_to_date ⇒ Object
The adjusted close price at the start of the calendar year.
-
#change ⇒ Object
The difference in last price from the last close price.
-
#change_percent ⇒ Object
The percent difference in last price from the last close price.
-
#change_percent_180_days ⇒ Object
The percent change from the adjusted price 180 days ago to now.
-
#change_percent_1825_days ⇒ Object
The percent change from the adjusted price 1825 days ago to now.
-
#change_percent_30_days ⇒ Object
The percent change from the adjusted price 30 days ago to now.
-
#change_percent_365_days ⇒ Object
The percent change from the adjusted price 365 days ago to now.
-
#change_percent_5_days ⇒ Object
The percent change from the adjusted price 5 days ago to now.
-
#change_percent_730_days_ago ⇒ Object
The percent change from the adjusted price 730 days ago to now.
-
#change_percent_90_days ⇒ Object
The percent change from the adjusted price 90 days ago to now.
-
#change_percent_year_to_date ⇒ Object
The percent change from the adjusted price since the start of the calendar year to now.
-
#eod_fifty_two_week_high ⇒ Object
The 52 week high price.
-
#eod_fifty_two_week_low ⇒ Object
The 52 week low price.
-
#exchange_volume ⇒ Object
The volume of the security from the source.
-
#extended_hours_change ⇒ Object
The difference in extended_hours_last price from most recent official close price.
-
#extended_hours_change_percent ⇒ Object
The percent difference in extended_hours_last from the most recent official close price.
-
#extended_hours_last ⇒ Object
The price of the latest trade in pre and post market trading.
-
#high ⇒ Object
The highest price from the latest day of trading.
-
#last ⇒ Object
The price of the latest trade.
-
#last_time ⇒ Object
The date and time when the last trade occurred.
-
#low ⇒ Object
The lowest price from the latest day of trading.
-
#market_volume ⇒ Object
The volume of the security for the entire market.
-
#marketcap ⇒ Object
The current market cap.
-
#open ⇒ Object
The open price from the latest day of trading.
-
#previous_close ⇒ Object
The previous close price.
-
#previous_close_date ⇒ Object
The date of the previous close.
-
#pricetoearnings ⇒ Object
The current price to earnings.
-
#security ⇒ Object
The Security of the stock quote.
-
#source ⇒ Object
The source of the pricing data.
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
-
#==(o) ⇒ 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?(o) ⇒ Boolean
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ ApiResponseSecurityQuote
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.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Constructor Details
#initialize(attributes = {}) ⇒ ApiResponseSecurityQuote
Initializes the object
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 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 |
# File 'lib/intrinio-sdk/models/api_response_security_quote.rb', line 213 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.has_key?(:'security') self.security = attributes[:'security'] end if attributes.has_key?(:'last') self.last = attributes[:'last'] end if attributes.has_key?(:'last_time') self.last_time = attributes[:'last_time'] end if attributes.has_key?(:'source') self.source = attributes[:'source'] end if attributes.has_key?(:'open') self.open = attributes[:'open'] end if attributes.has_key?(:'high') self.high = attributes[:'high'] end if attributes.has_key?(:'low') self.low = attributes[:'low'] end if attributes.has_key?(:'exchange_volume') self.exchange_volume = attributes[:'exchange_volume'] end if attributes.has_key?(:'market_volume') self.market_volume = attributes[:'market_volume'] end if attributes.has_key?(:'eod_fifty_two_week_high') self.eod_fifty_two_week_high = attributes[:'eod_fifty_two_week_high'] end if attributes.has_key?(:'eod_fifty_two_week_low') self.eod_fifty_two_week_low = attributes[:'eod_fifty_two_week_low'] end if attributes.has_key?(:'marketcap') self.marketcap = attributes[:'marketcap'] end if attributes.has_key?(:'pricetoearnings') self.pricetoearnings = attributes[:'pricetoearnings'] end if attributes.has_key?(:'previous_close') self.previous_close = attributes[:'previous_close'] end if attributes.has_key?(:'previous_close_date') self.previous_close_date = attributes[:'previous_close_date'] end if attributes.has_key?(:'change') self.change = attributes[:'change'] end if attributes.has_key?(:'change_percent') self.change_percent = attributes[:'change_percent'] end if attributes.has_key?(:'adj_close_5_days_ago') self.adj_close_5_days_ago = attributes[:'adj_close_5_days_ago'] end if attributes.has_key?(:'adj_close_30_days_ago') self.adj_close_30_days_ago = attributes[:'adj_close_30_days_ago'] end if attributes.has_key?(:'adj_close_90_days_ago') self.adj_close_90_days_ago = attributes[:'adj_close_90_days_ago'] end if attributes.has_key?(:'adj_close_180_days_ago') self.adj_close_180_days_ago = attributes[:'adj_close_180_days_ago'] end if attributes.has_key?(:'adj_close_365_days_ago') self.adj_close_365_days_ago = attributes[:'adj_close_365_days_ago'] end if attributes.has_key?(:'adj_close_730_days_ago') self.adj_close_730_days_ago = attributes[:'adj_close_730_days_ago'] end if attributes.has_key?(:'adj_close_1825_days_ago') self.adj_close_1825_days_ago = attributes[:'adj_close_1825_days_ago'] end if attributes.has_key?(:'adj_close_year_to_date') self.adj_close_year_to_date = attributes[:'adj_close_year_to_date'] end if attributes.has_key?(:'change_percent_5_days') self.change_percent_5_days = attributes[:'change_percent_5_days'] end if attributes.has_key?(:'change_percent_30_days') self.change_percent_30_days = attributes[:'change_percent_30_days'] end if attributes.has_key?(:'change_percent_90_days') self.change_percent_90_days = attributes[:'change_percent_90_days'] end if attributes.has_key?(:'change_percent_180_days') self.change_percent_180_days = attributes[:'change_percent_180_days'] end if attributes.has_key?(:'change_percent_365_days') self.change_percent_365_days = attributes[:'change_percent_365_days'] end if attributes.has_key?(:'change_percent_730_days_ago') self.change_percent_730_days_ago = attributes[:'change_percent_730_days_ago'] end if attributes.has_key?(:'change_percent_1825_days') self.change_percent_1825_days = attributes[:'change_percent_1825_days'] end if attributes.has_key?(:'change_percent_year_to_date') self.change_percent_year_to_date = attributes[:'change_percent_year_to_date'] end if attributes.has_key?(:'extended_hours_last') self.extended_hours_last = attributes[:'extended_hours_last'] end if attributes.has_key?(:'extended_hours_change') self.extended_hours_change = attributes[:'extended_hours_change'] end if attributes.has_key?(:'extended_hours_change_percent') self.extended_hours_change_percent = attributes[:'extended_hours_change_percent'] end end |
Instance Attribute Details
#adj_close_180_days_ago ⇒ Object
The adjusted close price 180 days ago.
79 80 81 |
# File 'lib/intrinio-sdk/models/api_response_security_quote.rb', line 79 def adj_close_180_days_ago @adj_close_180_days_ago end |
#adj_close_1825_days_ago ⇒ Object
The adjusted close price 1825 days ago.
88 89 90 |
# File 'lib/intrinio-sdk/models/api_response_security_quote.rb', line 88 def adj_close_1825_days_ago @adj_close_1825_days_ago end |
#adj_close_30_days_ago ⇒ Object
The adjusted close price 30 days ago.
73 74 75 |
# File 'lib/intrinio-sdk/models/api_response_security_quote.rb', line 73 def adj_close_30_days_ago @adj_close_30_days_ago end |
#adj_close_365_days_ago ⇒ Object
The adjusted close price 365 days ago.
82 83 84 |
# File 'lib/intrinio-sdk/models/api_response_security_quote.rb', line 82 def adj_close_365_days_ago @adj_close_365_days_ago end |
#adj_close_5_days_ago ⇒ Object
The adjusted close price 5 days ago.
70 71 72 |
# File 'lib/intrinio-sdk/models/api_response_security_quote.rb', line 70 def adj_close_5_days_ago @adj_close_5_days_ago end |
#adj_close_730_days_ago ⇒ Object
The adjusted close price 730 days ago.
85 86 87 |
# File 'lib/intrinio-sdk/models/api_response_security_quote.rb', line 85 def adj_close_730_days_ago @adj_close_730_days_ago end |
#adj_close_90_days_ago ⇒ Object
The adjusted close price 90 days ago.
76 77 78 |
# File 'lib/intrinio-sdk/models/api_response_security_quote.rb', line 76 def adj_close_90_days_ago @adj_close_90_days_ago end |
#adj_close_year_to_date ⇒ Object
The adjusted close price at the start of the calendar year.
91 92 93 |
# File 'lib/intrinio-sdk/models/api_response_security_quote.rb', line 91 def adj_close_year_to_date @adj_close_year_to_date end |
#change ⇒ Object
The difference in last price from the last close price
64 65 66 |
# File 'lib/intrinio-sdk/models/api_response_security_quote.rb', line 64 def change @change end |
#change_percent ⇒ Object
The percent difference in last price from the last close price
67 68 69 |
# File 'lib/intrinio-sdk/models/api_response_security_quote.rb', line 67 def change_percent @change_percent end |
#change_percent_180_days ⇒ Object
The percent change from the adjusted price 180 days ago to now.
103 104 105 |
# File 'lib/intrinio-sdk/models/api_response_security_quote.rb', line 103 def change_percent_180_days @change_percent_180_days end |
#change_percent_1825_days ⇒ Object
The percent change from the adjusted price 1825 days ago to now.
112 113 114 |
# File 'lib/intrinio-sdk/models/api_response_security_quote.rb', line 112 def change_percent_1825_days @change_percent_1825_days end |
#change_percent_30_days ⇒ Object
The percent change from the adjusted price 30 days ago to now.
97 98 99 |
# File 'lib/intrinio-sdk/models/api_response_security_quote.rb', line 97 def change_percent_30_days @change_percent_30_days end |
#change_percent_365_days ⇒ Object
The percent change from the adjusted price 365 days ago to now.
106 107 108 |
# File 'lib/intrinio-sdk/models/api_response_security_quote.rb', line 106 def change_percent_365_days @change_percent_365_days end |
#change_percent_5_days ⇒ Object
The percent change from the adjusted price 5 days ago to now.
94 95 96 |
# File 'lib/intrinio-sdk/models/api_response_security_quote.rb', line 94 def change_percent_5_days @change_percent_5_days end |
#change_percent_730_days_ago ⇒ Object
The percent change from the adjusted price 730 days ago to now.
109 110 111 |
# File 'lib/intrinio-sdk/models/api_response_security_quote.rb', line 109 def change_percent_730_days_ago @change_percent_730_days_ago end |
#change_percent_90_days ⇒ Object
The percent change from the adjusted price 90 days ago to now.
100 101 102 |
# File 'lib/intrinio-sdk/models/api_response_security_quote.rb', line 100 def change_percent_90_days @change_percent_90_days end |
#change_percent_year_to_date ⇒ Object
The percent change from the adjusted price since the start of the calendar year to now.
115 116 117 |
# File 'lib/intrinio-sdk/models/api_response_security_quote.rb', line 115 def change_percent_year_to_date @change_percent_year_to_date end |
#eod_fifty_two_week_high ⇒ Object
The 52 week high price.
46 47 48 |
# File 'lib/intrinio-sdk/models/api_response_security_quote.rb', line 46 def eod_fifty_two_week_high @eod_fifty_two_week_high end |
#eod_fifty_two_week_low ⇒ Object
The 52 week low price.
49 50 51 |
# File 'lib/intrinio-sdk/models/api_response_security_quote.rb', line 49 def eod_fifty_two_week_low @eod_fifty_two_week_low end |
#exchange_volume ⇒ Object
The volume of the security from the source.
40 41 42 |
# File 'lib/intrinio-sdk/models/api_response_security_quote.rb', line 40 def exchange_volume @exchange_volume end |
#extended_hours_change ⇒ Object
The difference in extended_hours_last price from most recent official close price
121 122 123 |
# File 'lib/intrinio-sdk/models/api_response_security_quote.rb', line 121 def extended_hours_change @extended_hours_change end |
#extended_hours_change_percent ⇒ Object
The percent difference in extended_hours_last from the most recent official close price
124 125 126 |
# File 'lib/intrinio-sdk/models/api_response_security_quote.rb', line 124 def extended_hours_change_percent @extended_hours_change_percent end |
#extended_hours_last ⇒ Object
The price of the latest trade in pre and post market trading. Might be null during normal trading
118 119 120 |
# File 'lib/intrinio-sdk/models/api_response_security_quote.rb', line 118 def extended_hours_last @extended_hours_last end |
#high ⇒ Object
The highest price from the latest day of trading.
34 35 36 |
# File 'lib/intrinio-sdk/models/api_response_security_quote.rb', line 34 def high @high end |
#last ⇒ Object
The price of the latest trade
22 23 24 |
# File 'lib/intrinio-sdk/models/api_response_security_quote.rb', line 22 def last @last end |
#last_time ⇒ Object
The date and time when the last trade occurred.
25 26 27 |
# File 'lib/intrinio-sdk/models/api_response_security_quote.rb', line 25 def last_time @last_time end |
#low ⇒ Object
The lowest price from the latest day of trading.
37 38 39 |
# File 'lib/intrinio-sdk/models/api_response_security_quote.rb', line 37 def low @low end |
#market_volume ⇒ Object
The volume of the security for the entire market.
43 44 45 |
# File 'lib/intrinio-sdk/models/api_response_security_quote.rb', line 43 def market_volume @market_volume end |
#marketcap ⇒ Object
The current market cap.
52 53 54 |
# File 'lib/intrinio-sdk/models/api_response_security_quote.rb', line 52 def marketcap @marketcap end |
#open ⇒ Object
The open price from the latest day of trading.
31 32 33 |
# File 'lib/intrinio-sdk/models/api_response_security_quote.rb', line 31 def open @open end |
#previous_close ⇒ Object
The previous close price.
58 59 60 |
# File 'lib/intrinio-sdk/models/api_response_security_quote.rb', line 58 def previous_close @previous_close end |
#previous_close_date ⇒ Object
The date of the previous close.
61 62 63 |
# File 'lib/intrinio-sdk/models/api_response_security_quote.rb', line 61 def previous_close_date @previous_close_date end |
#pricetoearnings ⇒ Object
The current price to earnings.
55 56 57 |
# File 'lib/intrinio-sdk/models/api_response_security_quote.rb', line 55 def pricetoearnings @pricetoearnings end |
#security ⇒ Object
The Security of the stock quote
19 20 21 |
# File 'lib/intrinio-sdk/models/api_response_security_quote.rb', line 19 def security @security end |
#source ⇒ Object
The source of the pricing data.
28 29 30 |
# File 'lib/intrinio-sdk/models/api_response_security_quote.rb', line 28 def source @source end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
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 |
# File 'lib/intrinio-sdk/models/api_response_security_quote.rb', line 128 def self.attribute_map { :'security' => :'security', :'last' => :'last', :'last_time' => :'last_time', :'source' => :'source', :'open' => :'open', :'high' => :'high', :'low' => :'low', :'exchange_volume' => :'exchange_volume', :'market_volume' => :'market_volume', :'eod_fifty_two_week_high' => :'eod_fifty_two_week_high', :'eod_fifty_two_week_low' => :'eod_fifty_two_week_low', :'marketcap' => :'marketcap', :'pricetoearnings' => :'pricetoearnings', :'previous_close' => :'previous_close', :'previous_close_date' => :'previous_close_date', :'change' => :'change', :'change_percent' => :'change_percent', :'adj_close_5_days_ago' => :'adj_close_5_days_ago', :'adj_close_30_days_ago' => :'adj_close_30_days_ago', :'adj_close_90_days_ago' => :'adj_close_90_days_ago', :'adj_close_180_days_ago' => :'adj_close_180_days_ago', :'adj_close_365_days_ago' => :'adj_close_365_days_ago', :'adj_close_730_days_ago' => :'adj_close_730_days_ago', :'adj_close_1825_days_ago' => :'adj_close_1825_days_ago', :'adj_close_year_to_date' => :'adj_close_year_to_date', :'change_percent_5_days' => :'change_percent_5_days', :'change_percent_30_days' => :'change_percent_30_days', :'change_percent_90_days' => :'change_percent_90_days', :'change_percent_180_days' => :'change_percent_180_days', :'change_percent_365_days' => :'change_percent_365_days', :'change_percent_730_days_ago' => :'change_percent_730_days_ago', :'change_percent_1825_days' => :'change_percent_1825_days', :'change_percent_year_to_date' => :'change_percent_year_to_date', :'extended_hours_last' => :'extended_hours_last', :'extended_hours_change' => :'extended_hours_change', :'extended_hours_change_percent' => :'extended_hours_change_percent' } end |
.swagger_types ⇒ Object
Attribute type mapping.
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 |
# File 'lib/intrinio-sdk/models/api_response_security_quote.rb', line 170 def self.swagger_types { :'security' => :'SecuritySummary', :'last' => :'Float', :'last_time' => :'DateTime', :'source' => :'String', :'open' => :'Float', :'high' => :'Float', :'low' => :'Float', :'exchange_volume' => :'Float', :'market_volume' => :'Float', :'eod_fifty_two_week_high' => :'Float', :'eod_fifty_two_week_low' => :'Float', :'marketcap' => :'Float', :'pricetoearnings' => :'Float', :'previous_close' => :'Float', :'previous_close_date' => :'Date', :'change' => :'Float', :'change_percent' => :'Float', :'adj_close_5_days_ago' => :'Float', :'adj_close_30_days_ago' => :'Float', :'adj_close_90_days_ago' => :'Float', :'adj_close_180_days_ago' => :'Float', :'adj_close_365_days_ago' => :'Float', :'adj_close_730_days_ago' => :'Float', :'adj_close_1825_days_ago' => :'Float', :'adj_close_year_to_date' => :'Float', :'change_percent_5_days' => :'Float', :'change_percent_30_days' => :'Float', :'change_percent_90_days' => :'Float', :'change_percent_180_days' => :'Float', :'change_percent_365_days' => :'Float', :'change_percent_730_days_ago' => :'Float', :'change_percent_1825_days' => :'Float', :'change_percent_year_to_date' => :'Float', :'extended_hours_last' => :'Float', :'extended_hours_change' => :'Float', :'extended_hours_change_percent' => :'Float' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
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 |
# File 'lib/intrinio-sdk/models/api_response_security_quote.rb', line 380 def ==(o) return true if self.equal?(o) self.class == o.class && security == o.security && last == o.last && last_time == o.last_time && source == o.source && open == o.open && high == o.high && low == o.low && exchange_volume == o.exchange_volume && market_volume == o.market_volume && eod_fifty_two_week_high == o.eod_fifty_two_week_high && eod_fifty_two_week_low == o.eod_fifty_two_week_low && marketcap == o.marketcap && pricetoearnings == o.pricetoearnings && previous_close == o.previous_close && previous_close_date == o.previous_close_date && change == o.change && change_percent == o.change_percent && adj_close_5_days_ago == o.adj_close_5_days_ago && adj_close_30_days_ago == o.adj_close_30_days_ago && adj_close_90_days_ago == o.adj_close_90_days_ago && adj_close_180_days_ago == o.adj_close_180_days_ago && adj_close_365_days_ago == o.adj_close_365_days_ago && adj_close_730_days_ago == o.adj_close_730_days_ago && adj_close_1825_days_ago == o.adj_close_1825_days_ago && adj_close_year_to_date == o.adj_close_year_to_date && change_percent_5_days == o.change_percent_5_days && change_percent_30_days == o.change_percent_30_days && change_percent_90_days == o.change_percent_90_days && change_percent_180_days == o.change_percent_180_days && change_percent_365_days == o.change_percent_365_days && change_percent_730_days_ago == o.change_percent_730_days_ago && change_percent_1825_days == o.change_percent_1825_days && change_percent_year_to_date == o.change_percent_year_to_date && extended_hours_last == o.extended_hours_last && extended_hours_change == o.extended_hours_change && extended_hours_change_percent == o.extended_hours_change_percent end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
457 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 |
# File 'lib/intrinio-sdk/models/api_response_security_quote.rb', line 457 def _deserialize(type, value) case type.to_sym when :DateTime DateTime.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 = Intrinio.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
523 524 525 526 527 528 529 530 531 532 533 534 535 |
# File 'lib/intrinio-sdk/models/api_response_security_quote.rb', line 523 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
436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 |
# File 'lib/intrinio-sdk/models/api_response_security_quote.rb', line 436 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| 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 attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) end # or else data not found in attributes(hash), not an issue as the data can be optional end self end |
#eql?(o) ⇒ Boolean
423 424 425 |
# File 'lib/intrinio-sdk/models/api_response_security_quote.rb', line 423 def eql?(o) self == o end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
429 430 431 |
# File 'lib/intrinio-sdk/models/api_response_security_quote.rb', line 429 def hash [security, last, last_time, source, open, high, low, exchange_volume, market_volume, eod_fifty_two_week_high, eod_fifty_two_week_low, marketcap, pricetoearnings, previous_close, previous_close_date, change, change_percent, adj_close_5_days_ago, adj_close_30_days_ago, adj_close_90_days_ago, adj_close_180_days_ago, adj_close_365_days_ago, adj_close_730_days_ago, adj_close_1825_days_ago, adj_close_year_to_date, change_percent_5_days, change_percent_30_days, change_percent_90_days, change_percent_180_days, change_percent_365_days, change_percent_730_days_ago, change_percent_1825_days, change_percent_year_to_date, extended_hours_last, extended_hours_change, extended_hours_change_percent].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
367 368 369 370 |
# File 'lib/intrinio-sdk/models/api_response_security_quote.rb', line 367 def list_invalid_properties invalid_properties = Array.new return invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
503 504 505 |
# File 'lib/intrinio-sdk/models/api_response_security_quote.rb', line 503 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
509 510 511 512 513 514 515 516 517 |
# File 'lib/intrinio-sdk/models/api_response_security_quote.rb', line 509 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
497 498 499 |
# File 'lib/intrinio-sdk/models/api_response_security_quote.rb', line 497 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
374 375 376 |
# File 'lib/intrinio-sdk/models/api_response_security_quote.rb', line 374 def valid? return true end |