class User

Public Class Methods

container_class() click to toggle source
# File core/user.rb, line 61
def self.container_class
  Users end
findbyidname(idname, count=Diva::DataSource::USE_ALL) click to toggle source
# File core/user.rb, line 105
def self.findbyidname(idname, count=Diva::DataSource::USE_ALL)
  memory.findbyidname(idname, count) end
memory() click to toggle source
# File core/user.rb, line 58
def self.memory
  @memory ||= UserMemory.new end
store_datum(datum) click to toggle source
Calls superclass method
# File core/user.rb, line 108
def self.store_datum(datum)
  return datum if datum[:id][0] == '+'[0]
  super
end
system() click to toggle source
# File core/user.rb, line 55
def self.system
  Mikutter::System::User.system end

Public Instance Methods

==(other) click to toggle source
# File core/user.rb, line 113
def ==(other)
  if other.is_a?(String) then
    @value[:idname] == other
  elsif other.is_a?(User) then
    other[:id] == self[:id] end end
follow() click to toggle source
# File core/user.rb, line 91
def follow
  if(@value[:post]) then
    @value[:post].follow(self)
  end
end
idname() click to toggle source
# File core/user.rb, line 67
def idname
  self[:idname] end
Also aliased as: to_s
inspect() click to toggle source
# File core/user.rb, line 97
def inspect
  "User(@#{@value[:idname]})"
end
is_me?(service = Service.instances)

互換性のため

Alias for: me?
me?(service = Service.instances) click to toggle source

このUserオブジェクトが、登録されているアカウントのうちいずれかのものであるなら true を返す

# File core/user.rb, line 120
def me?(service = Service.instances)
  if service.is_a? Enumerable
    service.any?(&method(:me?))
  elsif service.is_a? Service
    service.user_obj == self end end
Also aliased as: is_me?
profile_image_url_large() click to toggle source

大きいサイズのアイコンのURLを返す

Return

元のサイズのアイコンのURL

# File core/user.rb, line 86
def profile_image_url_large
  url = self[:profile_image_url]
  if url
    url.gsub(/_normal(.[a-zA-Z0-9]+)\Z/, '\1') end end
protected?() click to toggle source
# File core/user.rb, line 75
def protected?
  !!self[:protected]
end
system?() click to toggle source

投稿がシステムユーザだった場合にtrueを返す

# File core/user.rb, line 102
def system?
  false end
title() click to toggle source
# File core/user.rb, line 71
def title
  "#{idname}(#{name})"
end
to_s()
Alias for: idname
verified?() click to toggle source
# File core/user.rb, line 79
def verified?
  !!self[:verified]
end