Class: Serial::Builder Private
- Inherits:
-
Object
- Object
- Serial::Builder
- Defined in:
- lib/serial/builder.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Direct Known Subclasses
Instance Attribute Summary collapse
- #data ⇒ Object readonly private
Class Method Summary collapse
- .build(context, &block) ⇒ Object private
Instance Method Summary collapse
Instance Attribute Details
#data ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
8 9 10 |
# File 'lib/serial/builder.rb', line 8 def data @data end |
Class Method Details
.build(context, &block) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
4 5 6 |
# File 'lib/serial/builder.rb', line 4 def self.build(context, &block) new(context, &block).data end |
Instance Method Details
#build(builder_klass, *args, &block) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
18 19 20 21 22 |
# File 'lib/serial/builder.rb', line 18 def build(builder_klass, *args, &block) builder_klass.build(@context) do |builder| builder.exec(*args, &block) end end |
#exec(*args, &block) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
10 11 12 13 14 15 16 |
# File 'lib/serial/builder.rb', line 10 def exec(*args, &block) if @context @context.instance_exec(self, *args, &block) else block.call(self, *args) end end |