Class: Intrinio::CompanyDailyMetric
- Inherits:
-
Object
- Object
- Intrinio::CompanyDailyMetric
- Defined in:
- lib/intrinio-sdk/models/company_daily_metric.rb
Overview
A news article about a company
Instance Attribute Summary collapse
-
#company ⇒ Object
Returns the value of attribute company.
-
#date ⇒ Object
The date of the metric.
-
#dividend_yield ⇒ Object
The dividend yield.
-
#earnings_yield ⇒ Object
The earnings yield.
-
#enterprise_value ⇒ Object
The enterprise value.
-
#ev_to_ebit ⇒ Object
The enterprise value to earnings before interest and taxes ratio.
-
#ev_to_ebitda ⇒ Object
The enterprise value to earnings before interest, taxes, depreciation, and amoritization ratio.
-
#ev_to_fcff ⇒ Object
The enterprise value to free cash flow to the firm ratio.
-
#ev_to_invested_capital ⇒ Object
The enterprise value to invested capital ratio.
-
#ev_to_nopat ⇒ Object
The enterprise value to normalized operating profit after tax ratio.
-
#ev_to_ocf ⇒ Object
The enterprise value to operating cash flow ratio.
-
#ev_to_revenue ⇒ Object
The enterprise value to revenue ratio.
-
#market_cap ⇒ Object
The market cap.
-
#price_to_book ⇒ Object
The price to book ratio.
-
#price_to_earnings ⇒ Object
The price to earnings ratio.
-
#price_to_revenue ⇒ Object
The price to revenue ratio.
-
#price_to_tangible_book ⇒ Object
The price to tangible book ratio.
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 = {}) ⇒ CompanyDailyMetric
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 = {}) ⇒ CompanyDailyMetric
Initializes the object
117 118 119 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 |
# File 'lib/intrinio-sdk/models/company_daily_metric.rb', line 117 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?(:'date') self.date = attributes[:'date'] end if attributes.has_key?(:'enterprise_value') self.enterprise_value = attributes[:'enterprise_value'] end if attributes.has_key?(:'ev_to_ebit') self.ev_to_ebit = attributes[:'ev_to_ebit'] end if attributes.has_key?(:'ev_to_ebitda') self.ev_to_ebitda = attributes[:'ev_to_ebitda'] end if attributes.has_key?(:'market_cap') self.market_cap = attributes[:'market_cap'] end if attributes.has_key?(:'price_to_book') self.price_to_book = attributes[:'price_to_book'] end if attributes.has_key?(:'price_to_earnings') self.price_to_earnings = attributes[:'price_to_earnings'] end if attributes.has_key?(:'price_to_revenue') self.price_to_revenue = attributes[:'price_to_revenue'] end if attributes.has_key?(:'price_to_tangible_book') self.price_to_tangible_book = attributes[:'price_to_tangible_book'] end if attributes.has_key?(:'dividend_yield') self.dividend_yield = attributes[:'dividend_yield'] end if attributes.has_key?(:'earnings_yield') self.earnings_yield = attributes[:'earnings_yield'] end if attributes.has_key?(:'ev_to_invested_capital') self.ev_to_invested_capital = attributes[:'ev_to_invested_capital'] end if attributes.has_key?(:'ev_to_revenue') self.ev_to_revenue = attributes[:'ev_to_revenue'] end if attributes.has_key?(:'ev_to_nopat') self.ev_to_nopat = attributes[:'ev_to_nopat'] end if attributes.has_key?(:'ev_to_ocf') self.ev_to_ocf = attributes[:'ev_to_ocf'] end if attributes.has_key?(:'ev_to_fcff') self.ev_to_fcff = attributes[:'ev_to_fcff'] end if attributes.has_key?(:'company') self.company = attributes[:'company'] end end |
Instance Attribute Details
#company ⇒ Object
Returns the value of attribute company.
66 67 68 |
# File 'lib/intrinio-sdk/models/company_daily_metric.rb', line 66 def company @company end |
#date ⇒ Object
The date of the metric
19 20 21 |
# File 'lib/intrinio-sdk/models/company_daily_metric.rb', line 19 def date @date end |
#dividend_yield ⇒ Object
The dividend yield.
46 47 48 |
# File 'lib/intrinio-sdk/models/company_daily_metric.rb', line 46 def dividend_yield @dividend_yield end |
#earnings_yield ⇒ Object
The earnings yield.
49 50 51 |
# File 'lib/intrinio-sdk/models/company_daily_metric.rb', line 49 def earnings_yield @earnings_yield end |
#enterprise_value ⇒ Object
The enterprise value.
22 23 24 |
# File 'lib/intrinio-sdk/models/company_daily_metric.rb', line 22 def enterprise_value @enterprise_value end |
#ev_to_ebit ⇒ Object
The enterprise value to earnings before interest and taxes ratio.
25 26 27 |
# File 'lib/intrinio-sdk/models/company_daily_metric.rb', line 25 def ev_to_ebit @ev_to_ebit end |
#ev_to_ebitda ⇒ Object
The enterprise value to earnings before interest, taxes, depreciation, and amoritization ratio.
28 29 30 |
# File 'lib/intrinio-sdk/models/company_daily_metric.rb', line 28 def ev_to_ebitda @ev_to_ebitda end |
#ev_to_fcff ⇒ Object
The enterprise value to free cash flow to the firm ratio.
64 65 66 |
# File 'lib/intrinio-sdk/models/company_daily_metric.rb', line 64 def ev_to_fcff @ev_to_fcff end |
#ev_to_invested_capital ⇒ Object
The enterprise value to invested capital ratio.
52 53 54 |
# File 'lib/intrinio-sdk/models/company_daily_metric.rb', line 52 def ev_to_invested_capital @ev_to_invested_capital end |
#ev_to_nopat ⇒ Object
The enterprise value to normalized operating profit after tax ratio.
58 59 60 |
# File 'lib/intrinio-sdk/models/company_daily_metric.rb', line 58 def ev_to_nopat @ev_to_nopat end |
#ev_to_ocf ⇒ Object
The enterprise value to operating cash flow ratio.
61 62 63 |
# File 'lib/intrinio-sdk/models/company_daily_metric.rb', line 61 def ev_to_ocf @ev_to_ocf end |
#ev_to_revenue ⇒ Object
The enterprise value to revenue ratio.
55 56 57 |
# File 'lib/intrinio-sdk/models/company_daily_metric.rb', line 55 def ev_to_revenue @ev_to_revenue end |
#market_cap ⇒ Object
The market cap.
31 32 33 |
# File 'lib/intrinio-sdk/models/company_daily_metric.rb', line 31 def market_cap @market_cap end |
#price_to_book ⇒ Object
The price to book ratio.
34 35 36 |
# File 'lib/intrinio-sdk/models/company_daily_metric.rb', line 34 def price_to_book @price_to_book end |
#price_to_earnings ⇒ Object
The price to earnings ratio.
37 38 39 |
# File 'lib/intrinio-sdk/models/company_daily_metric.rb', line 37 def price_to_earnings @price_to_earnings end |
#price_to_revenue ⇒ Object
The price to revenue ratio.
40 41 42 |
# File 'lib/intrinio-sdk/models/company_daily_metric.rb', line 40 def price_to_revenue @price_to_revenue end |
#price_to_tangible_book ⇒ Object
The price to tangible book ratio.
43 44 45 |
# File 'lib/intrinio-sdk/models/company_daily_metric.rb', line 43 def price_to_tangible_book @price_to_tangible_book end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/intrinio-sdk/models/company_daily_metric.rb', line 70 def self.attribute_map { :'date' => :'date', :'enterprise_value' => :'enterprise_value', :'ev_to_ebit' => :'ev_to_ebit', :'ev_to_ebitda' => :'ev_to_ebitda', :'market_cap' => :'market_cap', :'price_to_book' => :'price_to_book', :'price_to_earnings' => :'price_to_earnings', :'price_to_revenue' => :'price_to_revenue', :'price_to_tangible_book' => :'price_to_tangible_book', :'dividend_yield' => :'dividend_yield', :'earnings_yield' => :'earnings_yield', :'ev_to_invested_capital' => :'ev_to_invested_capital', :'ev_to_revenue' => :'ev_to_revenue', :'ev_to_nopat' => :'ev_to_nopat', :'ev_to_ocf' => :'ev_to_ocf', :'ev_to_fcff' => :'ev_to_fcff', :'company' => :'company' } end |
.swagger_types ⇒ Object
Attribute type mapping.
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
# File 'lib/intrinio-sdk/models/company_daily_metric.rb', line 93 def self.swagger_types { :'date' => :'DateTime', :'enterprise_value' => :'Float', :'ev_to_ebit' => :'Float', :'ev_to_ebitda' => :'Float', :'market_cap' => :'Float', :'price_to_book' => :'Float', :'price_to_earnings' => :'Float', :'price_to_revenue' => :'Float', :'price_to_tangible_book' => :'Float', :'dividend_yield' => :'Float', :'earnings_yield' => :'Float', :'ev_to_invested_capital' => :'Float', :'ev_to_revenue' => :'Float', :'ev_to_nopat' => :'Float', :'ev_to_ocf' => :'Float', :'ev_to_fcff' => :'Float', :'company' => :'CompanySummary' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 |
# File 'lib/intrinio-sdk/models/company_daily_metric.rb', line 208 def ==(o) return true if self.equal?(o) self.class == o.class && date == o.date && enterprise_value == o.enterprise_value && ev_to_ebit == o.ev_to_ebit && ev_to_ebitda == o.ev_to_ebitda && market_cap == o.market_cap && price_to_book == o.price_to_book && price_to_earnings == o.price_to_earnings && price_to_revenue == o.price_to_revenue && price_to_tangible_book == o.price_to_tangible_book && dividend_yield == o.dividend_yield && earnings_yield == o.earnings_yield && ev_to_invested_capital == o.ev_to_invested_capital && ev_to_revenue == o.ev_to_revenue && ev_to_nopat == o.ev_to_nopat && ev_to_ocf == o.ev_to_ocf && ev_to_fcff == o.ev_to_fcff && company == o.company end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
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 |
# File 'lib/intrinio-sdk/models/company_daily_metric.rb', line 266 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
332 333 334 335 336 337 338 339 340 341 342 343 344 |
# File 'lib/intrinio-sdk/models/company_daily_metric.rb', line 332 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
245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 |
# File 'lib/intrinio-sdk/models/company_daily_metric.rb', line 245 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
232 233 234 |
# File 'lib/intrinio-sdk/models/company_daily_metric.rb', line 232 def eql?(o) self == o end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
238 239 240 |
# File 'lib/intrinio-sdk/models/company_daily_metric.rb', line 238 def hash [date, enterprise_value, ev_to_ebit, ev_to_ebitda, market_cap, price_to_book, price_to_earnings, price_to_revenue, price_to_tangible_book, dividend_yield, earnings_yield, ev_to_invested_capital, ev_to_revenue, ev_to_nopat, ev_to_ocf, ev_to_fcff, company].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
195 196 197 198 |
# File 'lib/intrinio-sdk/models/company_daily_metric.rb', line 195 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)
312 313 314 |
# File 'lib/intrinio-sdk/models/company_daily_metric.rb', line 312 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
318 319 320 321 322 323 324 325 326 |
# File 'lib/intrinio-sdk/models/company_daily_metric.rb', line 318 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
306 307 308 |
# File 'lib/intrinio-sdk/models/company_daily_metric.rb', line 306 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
202 203 204 |
# File 'lib/intrinio-sdk/models/company_daily_metric.rb', line 202 def valid? return true end |