Namespace
Methods
- B
- D
- E
- I
- N
- S
- U
Included Modules
- Enumerable
Attributes
[RW] | sieves |
Class Public methods
new(*_args)
Link
Source: show
# File rhino/rhino/lib/rhino/sieve.rb 79 def initialize(*_args) 80 @sieves = [] 81 yield(self) if block_given? 82 end
Instance Public methods
build(app = nil, &block)
Link
Source: show
# File rhino/rhino/lib/rhino/sieve.rb 131 def build(app = nil, &block) 132 instrumenting = ActiveSupport::Notifications.notifier.listening?(InstrumentationProxy::EVENT_NAME) 133 134 # Freeze only production so that reloading works 135 sieves.freeze unless Rails.env.development? 136 137 sieves.reverse.inject(app || block) do |a, e| 138 if instrumenting 139 e.build_instrumented(a) 140 else 141 e.build(a) 142 end 143 end 144 end
delete(target)
Link
Source: show
# File rhino/rhino/lib/rhino/sieve.rb 122 def delete(target) 123 sieves.delete_if { |m| m.klass == target } 124 end
each()
Link
rubocop:todo Style/ExplicitBlockArgument
Source: show
# File rhino/rhino/lib/rhino/sieve.rb 85 def each 86 @sieves.each { |x| yield x } 87 end
initialize_copy(other)
Link
Source: show
# File rhino/rhino/lib/rhino/sieve.rb 97 def initialize_copy(other) 98 self.sieves = other.sieves.dup 99 end
insert(index, klass, *args, &block)
Link
Also aliased as: insert_before
Source: show
# File rhino/rhino/lib/rhino/sieve.rb 101 def insert(index, klass, *args, &block) 102 index = assert_index(index, :before) 103 sieves.insert(index, build_sieve(klass, args, block)) 104 end
insert_after(index, *args, &block)
Link
Source: show
# File rhino/rhino/lib/rhino/sieve.rb 109 def insert_after(index, *args, &block) 110 index = assert_index(index, :after) 111 insert(index + 1, *args, &block) 112 end
swap(target, *args, &block)
Link
Source: show
# File rhino/rhino/lib/rhino/sieve.rb 115 def swap(target, *args, &block) 116 index = assert_index(target, :before) 117 insert(index, *args, &block) 118 sieves.delete_at(index + 1) 119 end