Method: Propertyware::Adjustment#initialize
- Defined in:
- lib/propertyware/models/adjustment.rb
#initialize(attributes = {}) ⇒ Adjustment
Initializes the object
104 105 106 107 108 109 110 111 112 113 114 115 116 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 |
# File 'lib/propertyware/models/adjustment.rb', line 104 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `Propertyware::Adjustment` 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 `Propertyware::Adjustment`. 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?(:'amount') self.amount = attributes[:'amount'] end if attributes.key?(:'comments') self.comments = attributes[:'comments'] end if attributes.key?(:'created_by') self.created_by = attributes[:'created_by'] end if attributes.key?(:'created_date_time') self.created_date_time = attributes[:'created_date_time'] end if attributes.key?(:'date') self.date = attributes[:'date'] end if attributes.key?(:'gl_account_id') self.gl_account_id = attributes[:'gl_account_id'] end if attributes.key?(:'id') self.id = attributes[:'id'] end if attributes.key?(:'last_modified_by') self.last_modified_by = attributes[:'last_modified_by'] end if attributes.key?(:'last_modified_date_time') self.last_modified_date_time = attributes[:'last_modified_date_time'] end if attributes.key?(:'lease_id') self.lease_id = attributes[:'lease_id'] end if attributes.key?(:'portfolio_id') self.portfolio_id = attributes[:'portfolio_id'] end if attributes.key?(:'ref_no') self.ref_no = attributes[:'ref_no'] end end |