Module: SimpleApiAuth::Authenticable

Defined in:
lib/simple-api-auth/authenticable.rb

Defined Under Namespace

Modules: ClassMethods, InstanceMethods

Instance Method Summary collapse

Instance Method Details

#acts_as_api_authenticable(options = {}) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/simple-api-auth/authenticable.rb', line 7

def acts_as_api_authenticable(options = {})
  if api_authenticable?
    self.saa_options = saa_options.merge(options)
  else
    extend ClassMethods
    include InstanceMethods
    self.saa_options = SimpleApiAuth.config.make_model_options(options)
    saa_options[:auto_generate].each do |field|
      send(:after_initialize, "assign_#{field}")
    end
  end
end

#api_authenticable?Boolean

Returns:

  • (Boolean)


3
4
5
# File 'lib/simple-api-auth/authenticable.rb', line 3

def api_authenticable?
  false
end