Method: Redox::Models::AbstractModel.from_response
- Defined in:
- lib/redox/models/model.rb
.from_response(response) ⇒ Object
37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/redox/models/model.rb', line 37 def self.from_response(response) model = Model.new model.response = response HIGH_LEVEL_KEYS.each do |k| begin model.send("#{k}=", Module.const_get("Redox::Models::#{k}").new(response[k])) if response[k] rescue end end return model end |