Class: Etna::Clients::Magma::RetrievalResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/etna/clients/magma/models.rb

Direct Known Subclasses

UpdateModelResponse, UpdateResponse

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(raw = {}) ⇒ RetrievalResponse

Returns a new instance of RetrievalResponse.



163
164
165
# File 'lib/etna/clients/magma/models.rb', line 163

def initialize(raw = {})
  @raw = raw
end

Instance Attribute Details

#rawObject (readonly)

Returns the value of attribute raw.



161
162
163
# File 'lib/etna/clients/magma/models.rb', line 161

def raw
  @raw
end

Instance Method Details

#modelsObject



167
168
169
# File 'lib/etna/clients/magma/models.rb', line 167

def models
  Models.new(raw['models'])
end

#update(response) ⇒ Object



171
172
173
174
175
# File 'lib/etna/clients/magma/models.rb', line 171

def update(response)
  response.models.each do |model_name, model|
    models.update( model_name, model )
  end
end