Class: FdxV660Api::InterestRateEntity8
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- FdxV660Api::InterestRateEntity8
- Defined in:
- lib/fdx_v660_api/models/interest_rate_entity8.rb
Overview
The periodic interest rate charged on the purchase
Instance Attribute Summary collapse
-
#compounding_period ⇒ CompoundingPeriod3
One of
DAILY,WEEKLY,BIWEEKLY,SEMIMONTHLY,MONTHLY,SEMIANNUALLY,ANNUALLY. -
#index ⇒ String
If an INDEXED rate, the name of the index to which the rate is tied:
EONIA,EURIBOR,EURREPO,FEFUND,LIBOR,PRIME,SOFR,SONIA, etc. -
#prior_rate ⇒ Float
Prior interest rate value, if any, before change on AsOf date.
-
#rate ⇒ Float
Current interest rate value.
-
#rate_as_of ⇒ Date
Date of change to the current interest rate value.
-
#type ⇒ InterestRateType1
One of
FIXED,INDEXEDorVARIABLE.
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.
-
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
Instance Method Summary collapse
-
#initialize(rate: SKIP, rate_as_of: SKIP, compounding_period: SKIP, prior_rate: SKIP, type: SKIP, index: SKIP, additional_properties: nil) ⇒ InterestRateEntity8
constructor
A new instance of InterestRateEntity8.
-
#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(rate: SKIP, rate_as_of: SKIP, compounding_period: SKIP, prior_rate: SKIP, type: SKIP, index: SKIP, additional_properties: nil) ⇒ InterestRateEntity8
Returns a new instance of InterestRateEntity8.
68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/fdx_v660_api/models/interest_rate_entity8.rb', line 68 def initialize(rate: SKIP, rate_as_of: SKIP, compounding_period: SKIP, prior_rate: SKIP, type: SKIP, index: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @rate = rate unless rate == SKIP @rate_as_of = rate_as_of unless rate_as_of == SKIP @compounding_period = compounding_period unless compounding_period == SKIP @prior_rate = prior_rate unless prior_rate == SKIP @type = type unless type == SKIP @index = index unless index == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#compounding_period ⇒ CompoundingPeriod3
One of DAILY, WEEKLY, BIWEEKLY, SEMIMONTHLY, MONTHLY,
SEMIANNUALLY, ANNUALLY
23 24 25 |
# File 'lib/fdx_v660_api/models/interest_rate_entity8.rb', line 23 def compounding_period @compounding_period end |
#index ⇒ String
If an INDEXED rate, the name of the index to which the rate is tied:
EONIA, EURIBOR, EURREPO, FEFUND, LIBOR, PRIME, SOFR,
SONIA, etc.
37 38 39 |
# File 'lib/fdx_v660_api/models/interest_rate_entity8.rb', line 37 def index @index end |
#prior_rate ⇒ Float
Prior interest rate value, if any, before change on AsOf date
27 28 29 |
# File 'lib/fdx_v660_api/models/interest_rate_entity8.rb', line 27 def prior_rate @prior_rate end |
#rate ⇒ Float
Current interest rate value
14 15 16 |
# File 'lib/fdx_v660_api/models/interest_rate_entity8.rb', line 14 def rate @rate end |
#rate_as_of ⇒ Date
Date of change to the current interest rate value
18 19 20 |
# File 'lib/fdx_v660_api/models/interest_rate_entity8.rb', line 18 def rate_as_of @rate_as_of end |
#type ⇒ InterestRateType1
One of FIXED, INDEXED or VARIABLE
31 32 33 |
# File 'lib/fdx_v660_api/models/interest_rate_entity8.rb', line 31 def type @type end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 |
# File 'lib/fdx_v660_api/models/interest_rate_entity8.rb', line 84 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. rate = hash.key?('rate') ? hash['rate'] : SKIP rate_as_of = hash.key?('rateAsOf') ? hash['rateAsOf'] : SKIP compounding_period = hash.key?('compoundingPeriod') ? hash['compoundingPeriod'] : SKIP prior_rate = hash.key?('priorRate') ? hash['priorRate'] : SKIP type = hash.key?('type') ? hash['type'] : SKIP index = hash.key?('index') ? hash['index'] : 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. InterestRateEntity8.new(rate: rate, rate_as_of: rate_as_of, compounding_period: compounding_period, prior_rate: prior_rate, type: type, index: index, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
40 41 42 43 44 45 46 47 48 49 |
# File 'lib/fdx_v660_api/models/interest_rate_entity8.rb', line 40 def self.names @_hash = {} if @_hash.nil? @_hash['rate'] = 'rate' @_hash['rate_as_of'] = 'rateAsOf' @_hash['compounding_period'] = 'compoundingPeriod' @_hash['prior_rate'] = 'priorRate' @_hash['type'] = 'type' @_hash['index'] = 'index' @_hash end |
.nullables ⇒ Object
An array for nullable fields
64 65 66 |
# File 'lib/fdx_v660_api/models/interest_rate_entity8.rb', line 64 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
52 53 54 55 56 57 58 59 60 61 |
# File 'lib/fdx_v660_api/models/interest_rate_entity8.rb', line 52 def self.optionals %w[ rate rate_as_of compounding_period prior_rate type index ] end |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
115 116 117 118 119 120 121 |
# File 'lib/fdx_v660_api/models/interest_rate_entity8.rb', line 115 def self.validate(value) return true if value.instance_of? self return false unless value.instance_of? Hash true end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
132 133 134 135 136 137 138 |
# File 'lib/fdx_v660_api/models/interest_rate_entity8.rb', line 132 def inspect class_name = self.class.name.split('::').last "<#{class_name} rate: #{@rate.inspect}, rate_as_of: #{@rate_as_of.inspect},"\ " compounding_period: #{@compounding_period.inspect}, prior_rate: #{@prior_rate.inspect},"\ " type: #{@type.inspect}, index: #{@index.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
124 125 126 127 128 129 |
# File 'lib/fdx_v660_api/models/interest_rate_entity8.rb', line 124 def to_s class_name = self.class.name.split('::').last "<#{class_name} rate: #{@rate}, rate_as_of: #{@rate_as_of}, compounding_period:"\ " #{@compounding_period}, prior_rate: #{@prior_rate}, type: #{@type}, index: #{@index},"\ " additional_properties: #{@additional_properties}>" end |