Class: Kungfuig::Prepender
- Inherits:
-
Object
- Object
- Kungfuig::Prepender
- Defined in:
- lib/kungfuig/prepender.rb
Defined Under Namespace
Classes: MalformedTarget
Constant Summary collapse
- AGRESSIVE_ERRORS =
true
Instance Attribute Summary collapse
-
#method ⇒ Object
readonly
Returns the value of attribute method.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#receiver ⇒ Object
readonly
Returns the value of attribute receiver.
-
#λ ⇒ Object
readonly
Returns the value of attribute λ.
Class Method Summary collapse
Instance Method Summary collapse
- #before(λ = nil) ⇒ Object (also: #after, #on_hook, #on_error)
-
#initialize(*args, **params) ⇒ Prepender
constructor
Parameters might be: • 1 — method instance — string in form “Class#method” • 2 — class (String, Symbol or Class), method name (String, Symbol) — instance (Object), method name (String, Symbol).
Constructor Details
#initialize(*args, **params) ⇒ Prepender
Parameters might be: • 1
• 2
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/kungfuig/prepender.rb', line 47 def initialize *args, **params @ |
Instance Attribute Details
#method ⇒ Object (readonly)
Returns the value of attribute method.
38 39 40 |
# File 'lib/kungfuig/prepender.rb', line 38 def method @method end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
38 39 40 |
# File 'lib/kungfuig/prepender.rb', line 38 def end |
#receiver ⇒ Object (readonly)
Returns the value of attribute receiver.
38 39 40 |
# File 'lib/kungfuig/prepender.rb', line 38 def receiver @receiver end |
#λ ⇒ Object (readonly)
Returns the value of attribute λ.
38 39 40 |
# File 'lib/kungfuig/prepender.rb', line 38 def |
Class Method Details
.anteponer(*args) ⇒ Object
32 33 34 35 |
# File 'lib/kungfuig/prepender.rb', line 32 def anteponer *args fail MalformedTarget.new "Factory requires a block; use Prepender#new for more accurate tuning", args unless block_given? Prepender.new(*args, &Proc.new) end |
.error!(e, **hash) ⇒ Object
28 29 30 |
# File 'lib/kungfuig/prepender.rb', line 28 def error! e, **hash errors << [e, hash] end |
.errors ⇒ Object
24 25 26 |
# File 'lib/kungfuig/prepender.rb', line 24 def errors @errors ||= [] end |
Instance Method Details
#before(λ = nil) ⇒ Object Also known as: after, on_hook, on_error
76 77 78 79 |
# File 'lib/kungfuig/prepender.rb', line 76 def before |