class User

Public Class Methods

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

Public Instance Methods

==(other) click to toggle source
# File core/user.rb, line 111
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 89
def follow
  if(@value[:post]) then
    @value[:post].follow(self)
  end
end
idname() click to toggle source
# File core/user.rb, line 65
def idname
  self[:idname] end
Also aliased as: to_s
inspect() click to toggle source
# File core/user.rb, line 95
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 118
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 84
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 73
def protected?
  !!self[:protected]
end
system?() click to toggle source

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

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