Home | History | Annotate | Download | only in jruby

Lines Matching refs:block

79      *     Builder.add_message(name, &block)
81 * Creates a new, empty descriptor with the given name, and invokes the block in
82 * the context of a MessageBuilderContext on that descriptor. The block can then
89 public IRubyObject addMessage(ThreadContext context, IRubyObject name, Block block) {
90 RubyDescriptor msgdef = (RubyDescriptor) cDescriptor.newInstance(context, Block.NULL_BLOCK);
91 IRubyObject ctx = cMessageBuilderContext.newInstance(context, msgdef, this, Block.NULL_BLOCK);
93 if (block.isGiven()) {
94 if (block.arity() == Arity.ONE_ARGUMENT) {
95 block.yield(context, ctx);
97 Binding binding = block.getBinding();
99 block.yieldSpecific(context);
108 * Builder.add_enum(name, &block)
110 * Creates a new, empty enum descriptor with the given name, and invokes the block in
111 * the context of an EnumBuilderContext on that descriptor. The block can then
117 public IRubyObject addEnum(ThreadContext context, IRubyObject name, Block block) {
118 RubyEnumDescriptor enumDef = (RubyEnumDescriptor) cEnumDescriptor.newInstance(context, Block.NULL_BLOCK);
119 IRubyObject ctx = cEnumBuilderContext.newInstance(context, enumDef, Block.NULL_BLOCK);
122 if (block.isGiven()) {
123 if (block.arity() == Arity.ONE_ARGUMENT) {
124 block.yield(context, ctx);
126 Binding binding = block.getBinding();
128 block.yieldSpecific(context);
146 * invokes the given user block in the context of the builder. The user should