class Atlas::User

Representation and handling of User objects.

Attributes

avatar_url[RW]
profile[RW]
username[RW]

Public Class Methods

find(tag) click to toggle source
# File lib/atlas/user.rb, line 6
def self.find(tag)
  url_builder = UrlBuilder.new(tag)
  response = Atlas.client.get(url_builder.user_url)

  new(tag, response)
end
new(tag, hash = {}) click to toggle source
Calls superclass method Atlas::Resource::new
# File lib/atlas/user.rb, line 13
def initialize(tag, hash = {})
  hash['profile'] = hash['profile_markdown']

  super(tag, hash)
end

Public Instance Methods

boxes() click to toggle source
# File lib/atlas/user.rb, line 19
def boxes
  @boxes ||= []
end
boxes=(hash) click to toggle source
# File lib/atlas/user.rb, line 23
def boxes=(hash)
  @boxes = hash.collect { |v| Box.new("#{username}/#{v['name']}", v) }
end