class Slurper::User
Attributes
attributes[RW]
Public Class Methods
collection()
click to toggle source
# File lib/slurper/user.rb, line 8 def self.collection @collection ||= Slurper::Client.users.map do |attrs| Slurper::User.new(attrs['person']) end end
find_by_name(name)
click to toggle source
# File lib/slurper/user.rb, line 14 def self.find_by_name(name) collection.detect { |user| user.name == name } end
new(attrs={})
click to toggle source
# File lib/slurper/user.rb, line 4 def initialize(attrs={}) self.attributes = (attrs || {}).symbolize_keys end
Public Instance Methods
id()
click to toggle source
# File lib/slurper/user.rb, line 19 def id; attributes[:id] end
name()
click to toggle source
# File lib/slurper/user.rb, line 18 def name; attributes[:name] end