Class: Passpartu::Patcher
- Inherits:
-
Object
- Object
- Passpartu::Patcher
- Defined in:
- lib/passpartu/patcher.rb
Instance Attribute Summary collapse
-
#klass ⇒ Object
readonly
Returns the value of attribute klass.
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(klass) ⇒ Patcher
constructor
A new instance of Patcher.
Constructor Details
#initialize(klass) ⇒ Patcher
Returns a new instance of Patcher.
4 5 6 |
# File 'lib/passpartu/patcher.rb', line 4 def initialize(klass) @klass = klass end |
Instance Attribute Details
#klass ⇒ Object (readonly)
Returns the value of attribute klass.
3 4 5 |
# File 'lib/passpartu/patcher.rb', line 3 def klass @klass end |
Class Method Details
.call(klass) ⇒ Object
8 9 10 |
# File 'lib/passpartu/patcher.rb', line 8 def self.call(klass) new(klass).call end |
Instance Method Details
#call ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/passpartu/patcher.rb', line 12 def call klass.class_eval do define_method('can?') do |*keys| Passpartu::Verify.call(role, keys) end end end |