Title / Description
Code class User attr_accessor :email attr_accessor :first_name attr_accessor :last_name attr_accessor :uuid attr_accessor :is_unknown_user attr_accessor :is_deactivated attr_accessor :is_account_admin attr_accessor :is_enterprise_admin attr_accessor :account_id attr_accessor :account_enterprise_id def initialize args = {} args.each do |k,v| send("#{k}=",v) end end def self.build_from_response r attrs = {} attrs['email'] = r['email'] attrs['first_name'] = r['first_name'] attrs['last_name'] = r['last_name'] attrs['uuid'] = r['uuid'] attrs['is_unknown_user'] = r['is_unknown_user'] attrs['is_deactivated'] = r['is_deactivated'] attrs['is_account_admin'] = r['is_account_admin'] attrs['is_enterprise_admin'] = r['is_enterprise_admin'] if r['account'] attrs['account_id'] = r['account']['id'] attrs['account_enterprise_id'] = r['account']['enterprise_id'] end new(attrs) end end
Author
Highlight as C C++ CSS Clojure Delphi ERb Groovy (beta) HAML HTML JSON Java JavaScript PHP Plain text Python Ruby SQL XML YAML diff code