Declares a block that will be executed when a Rails component is fully
 loaded.

 Options:

 * <tt>:yield</tt> - Yields the object that run_load_hooks to +block+.
 * <tt>:run_once</tt> - Given +block+ will run only once.
187580
def on_load(name, options = {}, &block)
      @loaded[name].each do |base|
        execute_hook(name, base, options, block)
      end

      @load_hooks[name] << [block, options]
    end
38145
def block_call (context, &block)
      args = []
      block.parameters.each do |parameter|
        args << context[parameter[1]]
      end
      block.call(*args)
    end
103938
def on_complete(&block)
      on do |_, value, reason|
        block.call(reason == nil, value, reason)
      end
    end
719450
def blocks(self, ignore_blank_lines=True):
        
        start, end = self.get_range(ignore_blank_lines=ignore_blank_lines)
        block = self._trigger.next()
        while block.blockNumber() <= end and block.isValid():
            yield block
            block = block.next()
791693
def yield_arg_block(compiler)
      arg_index = compiler.get_method.arguments_type.get_length - 1
      setup  = Mom::MessageSetup.new( arg_index )
      mom_receive = @receiver.slot_definition(compiler)
      arg_target = [:message , :next_message , :arguments]
      args = []
      @arguments.each_with_index do |arg , index| # +1 because of type
        args << Mom::SlotLoad.new( arg_target + [index + 1] , arg.slot_definition(compiler))
      end
      setup << Mom::ArgumentTransfer.new( mom_receive , args )
      setup << Mom::BlockYield.new( arg_index )
    end
811124
def run(*args)
      session, run_in_tx = session_and_run_in_tx_from_args(args)

      fail ArgumentError, 'Expected a block to run in Transaction.run' unless block_given?

      return yield(nil) unless run_in_tx

      tx = Neo4j::Transaction.new(session)
      yield tx
    rescue Exception => e # rubocop:disable Lint/RescueException
      # print_exception_cause(e)

      tx.mark_failed unless tx.nil?
      raise e
    ensure
      tx.close unless tx.nil?
    end
1132267
def spawn(args = {})
      gather_exemplars
      if @concrete_subclass_name
        return block_given? \
          ? const_get(@concrete_subclass_name).spawn(args) {|instance| yield instance} \
          : const_get(@concrete_subclass_name).spawn(args)
      end
      generate_values(args)
      instance = new(args)
      yield instance if block_given?
      instance
    end
900690
def each
      if block_given?
        length.times do |n|
          yield build_coordinate(n)
        end
        self
      else
        length.times.collect { |n|
          build_coordinate(n)
        }.to_enum
      end
    end
1267820
def on(page_class, browser = @browser)
      page = page_class.new(browser)
      yield page if block_given?
      page
    end
407655
def condition(proc)
      return unless block_given?
      @template.add_node Nodes::Condition.new(proc, sub_compile(nil, true) { yield })
    end
78460
def each(&block)
      @btree.each do |index, entry|
        if entry.is_a?(Collisions)
          break unless entry.each do |c_entry|
            yield(c_entry.key, c_entry.value)
          end
        else
          yield(entry.key, entry.value)
        end
      end
    end
761516
def render &block
      raise "Section #{folder_filepath} doesn't exist." unless Dir.exists? folder_filepath

      result = []
      render_assets result if Rails.application.config.assets.compile
      render_partial result, &block
      result.join("\n").html_safe
    end
17174
def perform_after(time, block=nil)
      task = Concurrent::ScheduledTask.new(time) do
        block = ->(){ yield } unless block
        self.async.perform_now block
      end
      task.execute
      task
    end
909156
def and_after_calling_original
      self.and_wrap_original do |m, *args, &block|
        result = m.call(*args, &block)
        yield result
        result
      end
    end
477330
def try(*args, &block)
      case
      when args.empty? && block_given?
        yield self
      when respond_to?(args.first)
        __send__(*args, &block)
      else
        @tag.try(*args, &block)
      end
    end
457308
def each(&block)
      # TODO: Using block.call here is slower than using yield by 5-10%, but
      # the latter segfaults on ruby 2.2 and above. Once that is fixed and
      # broken versions are sufficiently old, we should revert back to yield
      # with a warning that the broken versions are unsupported.
      #
      # For more context:
      # * https://bugs.ruby-lang.org/issues/11451
      # * https://github.com/hamstergem/hamster/issues/189
      @entries.each { |entry| block.call(entry) if entry }
      @children.each do |child|
        child.each(&block) if child
      end
      nil
    end
1010262
def start(self, *args, **kwargs):
        
        if self.is_running():
            raise RuntimeError('Already started')
        self._running = self.run(*args, **kwargs)
        try:
            yielded = next(self._running)
        except StopIteration:
            raise TypeError('run() must yield just one time')
        if yielded is not None:
            raise TypeError('run() must yield without value')