class Totango::User
Public Class Methods
new(args = {})
click to toggle source
# File lib/totango-api/user.rb, line 3 def initialize(args = {}) @attributes = Hash.new(nil) args.each {|k,v| self.send("#{k}=".to_sym,v)} end
Public Instance Methods
attributes()
click to toggle source
# File lib/totango-api/user.rb, line 30 def attributes @attributes.delete_if {|k,v| v.nil? } end
id()
click to toggle source
# File lib/totango-api/user.rb, line 8 def id @attributes["sdr_u"] end
id=(id)
click to toggle source
# File lib/totango-api/user.rb, line 11 def id=(id) @attributes["sdr_u"]=id end
method_missing(s,*args)
click to toggle source
# File lib/totango-api/user.rb, line 22 def method_missing(s,*args) m=s.to_s.sub(/=$/,"") attr_name = "sdr_u.#{m}" return @attributes[attr_name] = "#{args.join(" ")}" if args.length > 0 raise NoMethodError, "#{s.to_s} for #{self.class}" unless @attributes[attr_name] return @attributes[attr_name] end
name()
click to toggle source
# File lib/totango-api/user.rb, line 15 def name @attributes["sdr_u.name"] end
name=(n)
click to toggle source
# File lib/totango-api/user.rb, line 18 def name=(n) @attributes["sdr_u.name"]=n end