Sha256: e1bb8b3f18a3a1a5c25d7a37c4abe032b60a33d14ad3e97868cb0b5a58fa3f26

Contents?: true

Size: 560 Bytes

Versions: 2

Compression:

Stored size: 560 Bytes

Contents

module VGen
  class CharGen
    attr_reader :char_gen
    def initialize(
          only: [
            "`", "~", "!", "@", "#", "$", "%", "^",
            "&", "*", "(", ")", "-", "_", "+", "=",
            "[", "{", "]", "}", "\\", "|", ";", ":",
            "'", "\"", "<", ",", ">", ".", "?", "/",
            " "
          ] + ("a".."z").to_a + ("A".."Z").to_a + ("0".."9").to_a,
          except: []
        )
      @only, @except = only, except
    end
    
    def call()
      (@only.to_a - @except.to_a).sample
    end
  end
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
bsielski_control_flow-1.0.0 vendor/bundle/ruby/2.5.0/gems/bsielski_value_generator-1.4.0/lib/v_gen/char_gen.rb
bsielski_value_generator-1.4.0 lib/v_gen/char_gen.rb