Module: VV::StringMethods::ClassMethods

Defined in:
lib/vv/string_methods.rb

Instance Method Summary collapse

Instance Method Details

#capitalsObject



24
25
26
# File 'lib/vv/string_methods.rb', line 24

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

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



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

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

#lettersObject



16
17
18
# File 'lib/vv/string_methods.rb', line 16

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

#letters_and_numbers(capitals: false) ⇒ Object



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

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

#numbersObject



20
21
22
# File 'lib/vv/string_methods.rb', line 20

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

#vv_included?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/vv/string_methods.rb', line 12

def vv_included?
  true
end