Module: Ninsho

Defined in:
lib/ninsho.rb,
lib/ninsho/rails.rb,
lib/ninsho/railtie.rb,
lib/ninsho/version.rb,
lib/ninsho/omniauth.rb,
lib/ninsho/interface.rb,
lib/ninsho/routes_drawer.rb,
lib/ninsho/authentication.rb,
lib/ninsho/omniauth/config.rb,
lib/ninsho/controllers/helpers.rb,
lib/generators/ninsho/orm_helpers.rb,
lib/generators/ninsho/views_generator.rb,
lib/generators/ninsho/ninsho_generator.rb,
lib/generators/ninsho/install_generator.rb

Defined Under Namespace

Modules: Controllers, Generators, Interface, OmniAuth Classes: Authentication, Engine, Getter, Railtie, RoutesDrawer, SessionsController

Constant Summary collapse

VERSION =
"0.1.3"
@@parent_controller =
"ApplicationController"
@@resource_class =
""
@@resource_name =
""
@@providers =
[]
@@parent_resource_name =
'User'
@@omniauth_configs =
ActiveSupport::OrderedHash.new
@@parent_resource_holding_attributes =
[]

Class Method Summary collapse

Class Method Details

.omniauth(provider, *args) ⇒ Object

Used to specify an omniauth provider

config.omniauth :facebook, 'APPD_ID', 'APP_SECRET'


82
83
84
85
86
# File 'lib/ninsho.rb', line 82

def self.omniauth(provider, *args)
  config = Ninsho::OmniAuth::Config.new(provider, args)
  @@providers << config.strategy_name.to_sym
  @@omniauth_configs[config.strategy_name.to_sym] = config
end

.ref(arg) ⇒ Object



69
70
71
72
73
74
75
76
# File 'lib/ninsho.rb', line 69

def self.ref(arg)
  if defined?(ActiveSupport::Dependencies::ClassCache)
    ActiveSupport::Dependencies::reference(arg)
    Getter.new(arg)
  else
    ActiveSupport::Dependencies.ref(arg)
  end
end

.setup {|_self| ... } ⇒ Object

Default setup for Ninsho. Run the rails g ninsho:install to create a fresh initializer

Yields:

  • (_self)

Yield Parameters:

  • _self (Ninsho)

    the object that the method was called on



52
53
54
# File 'lib/ninsho.rb', line 52

def self.setup
  yield self
end