Sha256: 0220b0ecf2c5ff5e86a668e46ff9b15b0a7285955260d6dfb24d94dff27ab624

Contents?: true

Size: 689 Bytes

Versions: 1

Compression:

Stored size: 689 Bytes

Contents

# -*- encoding : utf-8 -*-

require 'active_support/core_ext/hash'

module Dito
  def self.generate_credentials(options)
    if options[:reference].present?
      id = options[:reference]
      id_type = nil
    elsif options[:facebook_id].present?
      id = options[:facebook_id]
      id_type = 'facebook_id'
    elsif options[:google_plus_id].present?
      id = options[:google_plus_id]
      id_type = 'google_plus_id'
    elsif options[:twitter_id].present?
      id = options[:twitter_id]
      id_type = 'twitter_id'
    elsif options[:id].present?
      id = options[:id]
      id_type = 'id'
    else
      id = nil
      id_type = nil
    end

    return id, id_type
  end
end 

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dito-0.0.4 lib/helpers/generate_credentials.rb