class Message::Message::DataSource

Public Instance Methods

findbyid(id, policy) click to toggle source
Calls superclass method Diva::Model::Memory#findbyid
# File core/plugin/twitter/model/message.rb, line 747
def findbyid(id, policy)
  if id.is_a? Enumerable
    super.map do |v|
      case v
      when Plugin::Twitter::Message
        v
      else
        findbyid(v)
      end
    end
  else
    result = super
    if result
      result
    elsif policy == Diva::DataSource::USE_ALL
      twitter = Enumerator.new{|y|
        Plugin.filtering(:worlds, y)
      }.find{|world|
        world.class.slug == :twitter
      }
      result = twitter.scan(:status_show, id: id)
      result
    end
  end
rescue Exception => err
  error err
  raise err
end