module AnyLogin

Constants

VERSION

Public Class Methods

collection() click to toggle source
# File lib/any_login.rb, line 91
def self.collection
  Collection.new(collection_raw)
end
klass() click to toggle source
# File lib/any_login.rb, line 95
def self.klass
  @@klass = AnyLogin.klass_name.constantize
end
setup() { |self| ... } click to toggle source
# File lib/any_login.rb, line 87
def self.setup
  yield(self)
end

Private Class Methods

collection_raw() click to toggle source
# File lib/any_login.rb, line 118
def self.collection_raw
  @@collection_raw = begin
    result = AnyLogin.klass.send(AnyLogin.collection_method)
    if limit == :none
      format_collection_raw(result)
    else
      if result.is_a?(ActiveRecord::Relation)
        format_collection_raw(result.limit(limit))
      else
        format_collection_raw(result.take(limit))
      end
    end
  end
end
format_collection_raw(result) click to toggle source
# File lib/any_login.rb, line 110
def self.format_collection_raw(result)
  if result.is_a?(Hash) || (Object.const_defined?("OrderedHash") && result.is_a?(OrderedHash))
    result.to_a
  else
    result
  end
end