Method: Serial::Serializer#initialize
- Defined in:
- lib/serial/serializer.rb
#initialize {|builder, value| ... } ⇒ Serializer
Create a new Serializer, using the block as instructions.
15 16 17 18 19 20 21 22 |
# File 'lib/serial/serializer.rb', line 15 def initialize(&block) unless block_given? raise ArgumentError, "instructions (block) is required" end @block = block @to_proc = method(:to_proc_implementation).to_proc end |