class FinnhubRuby::MutualFundProfileData

Attributes

benchmark[RW]

Index benchmark.

beta[RW]

Beta.

category[RW]

Fund's category.

cusip[RW]

CUSIP.

deferred_load[RW]

Deferred load.

description[RW]

Fund's description.

expense_ratio[RW]

Expense ratio.

fee12b1[RW]

12B-1 fee.

front_load[RW]

Front Load.

fund_family[RW]

Fund Family.

inception_date[RW]

Inception date.

investment_segment[RW]

Investment Segment.

ira_min_investment[RW]

IRA minimum investment.

isin[RW]

ISIN.

manager[RW]

Fund's managers.

max_redemption_fee[RW]

Max redemption fee.

name[RW]

Name

standard_min_investment[RW]

Minimum investment for standard accounts.

status[RW]

Status.

total_nav[RW]

NAV.

turnover[RW]

Turnover.

Public Class Methods

acceptable_attributes() click to toggle source

Returns all the JSON keys this model knows about

# File lib/finnhub_ruby/models/mutual_fund_profile_data.rb, line 109
def self.acceptable_attributes
  attribute_map.values
end
attribute_map() click to toggle source

Attribute mapping from ruby-style variable name to JSON key.

# File lib/finnhub_ruby/models/mutual_fund_profile_data.rb, line 82
def self.attribute_map
  {
    :'name' => :'name',
    :'category' => :'category',
    :'investment_segment' => :'investmentSegment',
    :'total_nav' => :'totalNav',
    :'expense_ratio' => :'expenseRatio',
    :'benchmark' => :'benchmark',
    :'inception_date' => :'inceptionDate',
    :'description' => :'description',
    :'fund_family' => :'fundFamily',
    :'manager' => :'manager',
    :'status' => :'status',
    :'beta' => :'beta',
    :'deferred_load' => :'deferredLoad',
    :'fee12b1' => :'fee12b1',
    :'front_load' => :'frontLoad',
    :'ira_min_investment' => :'iraMinInvestment',
    :'isin' => :'isin',
    :'cusip' => :'cusip',
    :'max_redemption_fee' => :'maxRedemptionFee',
    :'standard_min_investment' => :'standardMinInvestment',
    :'turnover' => :'turnover'
  }
end
build_from_hash(attributes) click to toggle source

Builds the object from hash @param [Hash] attributes Model attributes in the form of hash @return [Object] Returns the model itself

# File lib/finnhub_ruby/models/mutual_fund_profile_data.rb, line 302
def self.build_from_hash(attributes)
  new.build_from_hash(attributes)
end
new(attributes = {}) click to toggle source

Initializes the object @param [Hash] attributes Model attributes in the form of hash

# File lib/finnhub_ruby/models/mutual_fund_profile_data.rb, line 148
def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `FinnhubRuby::MutualFundProfileData` initialize method"
  end

  # check to see if the attribute exists and convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h|
    if (!self.class.attribute_map.key?(k.to_sym))
      fail ArgumentError, "`#{k}` is not a valid attribute in `FinnhubRuby::MutualFundProfileData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
    end
    h[k.to_sym] = v
  }

  if attributes.key?(:'name')
    self.name = attributes[:'name']
  end

  if attributes.key?(:'category')
    self.category = attributes[:'category']
  end

  if attributes.key?(:'investment_segment')
    self.investment_segment = attributes[:'investment_segment']
  end

  if attributes.key?(:'total_nav')
    self.total_nav = attributes[:'total_nav']
  end

  if attributes.key?(:'expense_ratio')
    self.expense_ratio = attributes[:'expense_ratio']
  end

  if attributes.key?(:'benchmark')
    self.benchmark = attributes[:'benchmark']
  end

  if attributes.key?(:'inception_date')
    self.inception_date = attributes[:'inception_date']
  end

  if attributes.key?(:'description')
    self.description = attributes[:'description']
  end

  if attributes.key?(:'fund_family')
    self.fund_family = attributes[:'fund_family']
  end

  if attributes.key?(:'manager')
    self.manager = attributes[:'manager']
  end

  if attributes.key?(:'status')
    self.status = attributes[:'status']
  end

  if attributes.key?(:'beta')
    self.beta = attributes[:'beta']
  end

  if attributes.key?(:'deferred_load')
    self.deferred_load = attributes[:'deferred_load']
  end

  if attributes.key?(:'fee12b1')
    self.fee12b1 = attributes[:'fee12b1']
  end

  if attributes.key?(:'front_load')
    self.front_load = attributes[:'front_load']
  end

  if attributes.key?(:'ira_min_investment')
    self.ira_min_investment = attributes[:'ira_min_investment']
  end

  if attributes.key?(:'isin')
    self.isin = attributes[:'isin']
  end

  if attributes.key?(:'cusip')
    self.cusip = attributes[:'cusip']
  end

  if attributes.key?(:'max_redemption_fee')
    self.max_redemption_fee = attributes[:'max_redemption_fee']
  end

  if attributes.key?(:'standard_min_investment')
    self.standard_min_investment = attributes[:'standard_min_investment']
  end

  if attributes.key?(:'turnover')
    self.turnover = attributes[:'turnover']
  end
end
openapi_nullable() click to toggle source

List of attributes with nullable: true

# File lib/finnhub_ruby/models/mutual_fund_profile_data.rb, line 141
def self.openapi_nullable
  Set.new([
  ])
end
openapi_types() click to toggle source

Attribute type mapping.

# File lib/finnhub_ruby/models/mutual_fund_profile_data.rb, line 114
def self.openapi_types
  {
    :'name' => :'String',
    :'category' => :'String',
    :'investment_segment' => :'String',
    :'total_nav' => :'Float',
    :'expense_ratio' => :'Float',
    :'benchmark' => :'String',
    :'inception_date' => :'Date',
    :'description' => :'String',
    :'fund_family' => :'String',
    :'manager' => :'String',
    :'status' => :'String',
    :'beta' => :'Float',
    :'deferred_load' => :'Float',
    :'fee12b1' => :'Float',
    :'front_load' => :'Float',
    :'ira_min_investment' => :'Float',
    :'isin' => :'String',
    :'cusip' => :'String',
    :'max_redemption_fee' => :'Float',
    :'standard_min_investment' => :'Float',
    :'turnover' => :'Float'
  }
end

Public Instance Methods

==(o) click to toggle source

Checks equality by comparing each attribute. @param [Object] Object to be compared

# File lib/finnhub_ruby/models/mutual_fund_profile_data.rb, line 261
def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      name == o.name &&
      category == o.category &&
      investment_segment == o.investment_segment &&
      total_nav == o.total_nav &&
      expense_ratio == o.expense_ratio &&
      benchmark == o.benchmark &&
      inception_date == o.inception_date &&
      description == o.description &&
      fund_family == o.fund_family &&
      manager == o.manager &&
      status == o.status &&
      beta == o.beta &&
      deferred_load == o.deferred_load &&
      fee12b1 == o.fee12b1 &&
      front_load == o.front_load &&
      ira_min_investment == o.ira_min_investment &&
      isin == o.isin &&
      cusip == o.cusip &&
      max_redemption_fee == o.max_redemption_fee &&
      standard_min_investment == o.standard_min_investment &&
      turnover == o.turnover
end
_deserialize(type, value) click to toggle source

Deserializes the data based on type @param string type Data type @param string value Value to be deserialized @return [Object] Deserialized data

# File lib/finnhub_ruby/models/mutual_fund_profile_data.rb, line 332
def _deserialize(type, value)
  case type.to_sym
  when :Time
    Time.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
    # models (e.g. Pet) or oneOf
    klass = FinnhubRuby.const_get(type)
    klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
  end
end
_to_hash(value) click to toggle source

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value @param [Object] value Any valid value @return [Hash] Returns the value in the form of hash

# File lib/finnhub_ruby/models/mutual_fund_profile_data.rb, line 403
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) click to toggle source

Builds the object from hash @param [Hash] attributes Model attributes in the form of hash @return [Object] Returns the model itself

# File lib/finnhub_ruby/models/mutual_fund_profile_data.rb, line 309
def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  self.class.openapi_types.each_pair do |key, type|
    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
      self.send("#{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[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
  end

  self
end
eql?(o) click to toggle source

@see the `==` method @param [Object] Object to be compared

# File lib/finnhub_ruby/models/mutual_fund_profile_data.rb, line 289
def eql?(o)
  self == o
end
hash() click to toggle source

Calculates hash code according to all attributes. @return [Integer] Hash code

# File lib/finnhub_ruby/models/mutual_fund_profile_data.rb, line 295
def hash
  [name, category, investment_segment, total_nav, expense_ratio, benchmark, inception_date, description, fund_family, manager, status, beta, deferred_load, fee12b1, front_load, ira_min_investment, isin, cusip, max_redemption_fee, standard_min_investment, turnover].hash
end
list_invalid_properties() click to toggle source

Show invalid properties with the reasons. Usually used together with valid? @return Array for valid properties with the reasons

# File lib/finnhub_ruby/models/mutual_fund_profile_data.rb, line 248
def list_invalid_properties
  invalid_properties = Array.new
  invalid_properties
end
to_body() click to toggle source

to_body is an alias to to_hash (backward compatibility) @return [Hash] Returns the object in the form of hash

# File lib/finnhub_ruby/models/mutual_fund_profile_data.rb, line 379
def to_body
  to_hash
end
to_hash() click to toggle source

Returns the object in the form of hash @return [Hash] Returns the object in the form of hash

# File lib/finnhub_ruby/models/mutual_fund_profile_data.rb, line 385
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
to_s() click to toggle source

Returns the string representation of the object @return [String] String presentation of the object

# File lib/finnhub_ruby/models/mutual_fund_profile_data.rb, line 373
def to_s
  to_hash.to_s
end
valid?() click to toggle source

Check to see if the all the properties in the model are valid @return true if the model is valid

# File lib/finnhub_ruby/models/mutual_fund_profile_data.rb, line 255
def valid?
  true
end