Class: ActiveEntry::Base
- Inherits:
-
Object
show all
- Defined in:
- lib/active_entry/base.rb
Defined Under Namespace
Classes: Authentication, Authorization
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
#initialize(method_name, **args) ⇒ Base
Returns a new instance of Base.
27
28
29
30
31
|
# File 'lib/active_entry/base.rb', line 27
def initialize method_name, **args
@_method_name_to_entrify = method_name
@_args = args
@_args.each { |name, value| instance_variable_set ["@", name].join, value }
end
|
Class Method Details
.pass!(method_name, **args) ⇒ Object
.pass?(method_name, **args) ⇒ Boolean
Instance Method Details
#pass! ⇒ Object
46
47
48
|
# File 'lib/active_entry/base.rb', line 46
def pass!
pass? or raise self.class::AUTH_ERROR.new(@error, @_method_name_to_entrify, @_args)
end
|
#pass? ⇒ Boolean
50
51
52
|
# File 'lib/active_entry/base.rb', line 50
def pass?
decision_maker_method.call == true
end
|
#success ⇒ Object
54
55
56
|
# File 'lib/active_entry/base.rb', line 54
def success
true
end
|