Sha256: 79a1499f5109af4098d6ced3bd00c5ec636a5df77c4c9ff941e65741120c6ca4

Contents?: true

Size: 323 Bytes

Versions: 5

Compression:

Stored size: 323 Bytes

Contents

module Fix
  module Helper
    module LetWriterHelper
      def let name, &block
        @defs = {} unless instance_variable_defined? :@defs

        if @defs.key? name
          raise IndexError, 'the given key is already present.'
        else
          @defs.update name => block
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
fix-0.6.1 lib/fix/helper/let_writer_helper.rb
fix-0.6.0 lib/fix/helper/let_writer_helper.rb
fix-0.5.0 lib/fix/helper/let_writer_helper.rb
fix-0.4.0 lib/fix/helper/let_writer_helper.rb
fix-0.3.0 lib/fix/helper/let_writer_helper.rb