Class: RemoteSubject

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/remote_subject.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.find_or_create_using_wslug(slug) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
# File 'app/models/remote_subject.rb', line 7

def find_or_create_using_wslug(slug)
  r_user = RemoteSubject.find_by_webfinger_slug(slug)
  if r_user == nil
    wfslug = slug.split('@')
    r_user = RemoteSubject.create!(:name => wfslug[0], 
                                :webfinger_slug => slug,
                                :origin_node_url => wfslug[1],
                                :hub_url => Social2social.hub)
  end
  r_user
end

Instance Method Details

#public_feed_urlObject

Public feed url for this RemoteUser



21
22
23
# File 'app/models/remote_subject.rb', line 21

def public_feed_url
  "http://"+origin_node_url.to_s+"/api/user/"+name.to_s+"/public.atom"                       
end