module Medlink class Interne include Virtus.model attribute :id, Integer attribute :first_name, String attribute :last_name, String attribute :ecn_year, Integer attribute :ecn_ranking, Integer attribute :internat_end_year, Integer attribute :birthdate, Date attribute :speciality, Medlink::Speciality attribute :city, Medlink::City def self.where(client, params) response = client.get('/internes', params) if response.status == 200 json = JSON.parse response.body internes = [] json.each do |json_item| internes << self.new(json_item) end internes end end end end