Class: Service

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

Overview

Copyright © 2010-2011, Diaspora Inc. This file is

licensed under the Affero General Public License version 3 or later.  See
the COPYRIGHT file.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#access_levelObject

Returns the value of attribute access_level


6
7
8
# File 'app/models/service.rb', line 6

def access_level
  @access_level
end

#infoObject

Returns the value of attribute info


6
7
8
# File 'app/models/service.rb', line 6

def info
  @info
end

#providerObject

Returns the value of attribute provider


6
7
8
# File 'app/models/service.rb', line 6

def provider
  @provider
end

Class Method Details

.first_from_omniauth(auth_hash) ⇒ Object


25
26
27
28
# File 'app/models/service.rb', line 25

def first_from_omniauth( auth_hash )
  @@auth = auth_hash
  where( type: service_type, uid: options[:uid] ).first
end

.initialize_from_omniauth(auth_hash) ⇒ Object


30
31
32
33
# File 'app/models/service.rb', line 30

def initialize_from_omniauth( auth_hash )
  @@auth = auth_hash
  service_type.constantize.new( options )
end

.titles(service_strings) ⇒ Object


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

def titles(service_strings)
  service_strings.map {|s| "Services::#{s.titleize}"}
end

Instance Method Details

#delete_post(post) ⇒ Object


15
16
17
# File 'app/models/service.rb', line 15

def delete_post(post)
  #don't do anything (should be overriden by service extensions)
end

#profile_photo_urlObject


11
12
13
# File 'app/models/service.rb', line 11

def profile_photo_url
  nil
end