title: How to get values from an object in a hashmap in kotlin android using mvvm
body: <p>I have a hashmap in my data/model class because the object key is dynamic</p>
  <p><strong>ApiResponse</strong></p>
  <pre><code>data class ApiResponse(
  val amount: String,
  var rates: HashMap&lt;String, Rates&gt; = HashMap())
  </code></pre>
  <p><strong>Rates</strong></p>
  <pre><code>data class Rates(
  val currency_name: String,
  val rate: String,
  val rate_for_amount: Double)
  </code></pre>
  <p><strong>View</strong></p>
  <pre><code> val map: Map&lt;String, Rates&gt; map = result.data.rates
  </code></pre>
  <p>The data gotten from this comes in this format</p>
  <pre><code>{AFN=Rates(currency_name=Afghani, rate=1.0000, rate_for_amount=5.0)}
  </code></pre>
  <p>Now I have 2 questions.</p>
  <p><strong>1</strong> I am using MVVM, is it right that my Model (<strong>Rates</strong>) is interacting directly with my View? If No, how do I refactor for clean architecture.</p>
  <p><strong>2</strong> How do I get the value for the key <code>rate_for_amount</code> based on the data/result obtained, which is an object</p>