Module: VV::StringMethods::ClassMethods

Defined in:
lib/vv/string_methods.rb

Instance Method Summary collapse

Instance Method Details

#capitalsObject



30
31
32
# File 'lib/vv/string_methods.rb', line 30

def capitals
  ("A".."Z").to_a
end

#capture_stdout(&block) ⇒ Object Also known as: get_stdout



40
41
42
43
44
45
46
47
# File 'lib/vv/string_methods.rb', line 40

def capture_stdout(&block)
  original_stdout = $stdout
  $stdout = StringIO.new
  yield
  $stdout.string
ensure
  $stdout = original_stdout
end

#lettersObject



22
23
24
# File 'lib/vv/string_methods.rb', line 22

def letters
  ("a".."z").to_a
end

#letters_and_numbers(capitals: false) ⇒ Object



34
35
36
37
38
# File 'lib/vv/string_methods.rb', line 34

def letters_and_numbers capitals: false
  response  = self.letters
  response += self.capitals if capitals
  response += self.numbers
end

#numbersObject



26
27
28
# File 'lib/vv/string_methods.rb', line 26

def numbers
  ("0".."9").to_a
end

#vv_included?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/vv/string_methods.rb', line 18

def vv_included?
  true
end