Module: Lasso::Model::InstanceMethods

Defined in:
lib/lasso/model/instance.rb

Instance Method Summary collapse

Instance Method Details

#config(key) ⇒ Object



4
5
6
# File 'lib/lasso/model/instance.rb', line 4

def config(key)
  oauth_providers[service][key]
end

#duplicateObject



10
11
12
# File 'lib/lasso/model/instance.rb', line 10

def duplicate
  self.class.find(:first, :conditions => ['service = ? and token_a = ?', service, token_a])
end

#set_typeObject



7
8
9
# File 'lib/lasso/model/instance.rb', line 7

def set_type
  self.type ||= "OAuth#{config(:oauth_version) == 1 && 'One' || 'Two'}#{self.class.to_s}"
end