class User

Public Class Methods

findbyidname(idname, count=Diva::DataSource::USE_ALL) click to toggle source
# File core/plugin/twitter/model/user.rb, line 124
def self.findbyidname(idname, count=Diva::DataSource::USE_ALL)
  memory.findbyidname(idname, count) end
memory() click to toggle source
# File core/plugin/twitter/model/user.rb, line 57
def self.memory
  @memory ||= UserMemory.new end
store_datum(datum) click to toggle source
Calls superclass method
# File core/plugin/twitter/model/user.rb, line 127
def self.store_datum(datum)
  return datum if datum[:id][0] == '+'[0]
  super
end
system() click to toggle source
# File core/plugin/twitter/model/user.rb, line 54
def self.system
  Mikutter::System::User.system end

Public Instance Methods

==(other) click to toggle source
# File core/plugin/twitter/model/user.rb, line 132
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/plugin/twitter/model/user.rb, line 110
def follow
  if(@value[:post]) then
    @value[:post].follow(self)
  end
end
icon() click to toggle source
# File core/plugin/twitter/model/user.rb, line 79
def icon
  @icon ||=
    begin
      photo = Diva::Model(:photo)
      photo.generate([{policy: :original,
                       photo: profile_image_url.gsub(/_normal(.[a-zA-Z0-9]+)\Z/, '\1')},
                      {name: :mini,
                       width: 24, height: 24,
                       policy: :fit,
                       photo: profile_image_url.gsub(/_normal(.[a-zA-Z0-9]+)\Z/, '_mini\1')},
                      {name: :normal,
                       width: 48, height: 48,
                       policy: :fit,
                       photo: profile_image_url},
                      {name: :bigger,
                       width: 73, height: 73,
                       policy: :fit,
                       photo: profile_image_url.gsub(/_normal(.[a-zA-Z0-9]+)\Z/, '_bigger\1')} ],
                     perma_link: profile_image_url)
    end
end
Also aliased as: icon_large
icon_large()
Alias for: icon
idname() click to toggle source
# File core/plugin/twitter/model/user.rb, line 63
def idname
  self[:idname] end
Also aliased as: to_s
inspect() click to toggle source
# File core/plugin/twitter/model/user.rb, line 116
def inspect
  "TwitterUser(@#{@value[:idname]})"
end
is_me?(world = Enumerator.new{|y| Plugin.filtering(:worlds, y) })

互換性のため

Alias for: me?
me?(world = Enumerator.new{|y| Plugin.filtering(:worlds, y) }) click to toggle source

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

# File core/plugin/twitter/model/user.rb, line 139
def me?(world = Enumerator.new{|y| Plugin.filtering(:worlds, y) })
  case world
  when Enumerable
    world.any?(&method(:me?))
  when Diva::Model
    world.class.slug == :twitter && world.user_obj == self
  end
end
Also aliased as: is_me?
profile_image_url_large() click to toggle source

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

Return

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

# File core/plugin/twitter/model/user.rb, line 105
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/plugin/twitter/model/user.rb, line 71
def protected?
  !!self[:protected]
end
system?() click to toggle source

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

# File core/plugin/twitter/model/user.rb, line 121
def system?
  false end
title() click to toggle source
# File core/plugin/twitter/model/user.rb, line 67
def title
  "#{idname}(#{name})"
end
to_s()
Alias for: idname
verified?() click to toggle source
# File core/plugin/twitter/model/user.rb, line 75
def verified?
  !!self[:verified]
end