class Plugin::Twitter::DirectMessage

Public Class Methods

memory() click to toggle source
# File core/plugin/twitter/model/directmessage.rb, line 21
def self.memory
  @memory ||= DirectMessageMemory.new end

Public Instance Methods

from_me?(world = Enumerator.new{|y| Plugin.filtering(:worlds, y) }) click to toggle source
# File core/plugin/twitter/model/directmessage.rb, line 32
def from_me?(world = Enumerator.new{|y| Plugin.filtering(:worlds, y) })
  case world
  when Enumerable
    world.any?(&method(:from_me?))
  when Diva::Model
    world.class.slug == :twitter && world.user_obj == self.user
  end
end
mentioned_by_me?() click to toggle source
# File core/plugin/twitter/model/directmessage.rb, line 24
def mentioned_by_me?
  false
end
post(args, &block) click to toggle source
# File core/plugin/twitter/model/directmessage.rb, line 45
def post(args, &block)
  Service.primary.send_direct_message({:text => args[:message], :user => self[:user]}, &block)
end
receive_user_screen_names() click to toggle source
# File core/plugin/twitter/model/directmessage.rb, line 53
def receive_user_screen_names
  [self[:recipient].idname]
end
repliable?() click to toggle source
# File core/plugin/twitter/model/directmessage.rb, line 49
def repliable?
  true
end
to_me?() click to toggle source
# File core/plugin/twitter/model/directmessage.rb, line 41
def to_me?
  true
end
to_show() click to toggle source
# File core/plugin/twitter/model/directmessage.rb, line 28
def to_show
  @to_show ||= self[:text].gsub(/&(gt|lt|quot|amp);/){|m| {'gt' => '>', 'lt' => '<', 'quot' => '"', 'amp' => '&'}[$1] }.freeze
end