Module: VV::StringMethods::ClassMethods
- Defined in:
- lib/vv/string_methods.rb
Instance Method Summary collapse
- #capitals ⇒ Object
- #capture_stdout(&block) ⇒ Object (also: #get_stdout)
- #letters ⇒ Object
- #letters_and_numbers(capitals: false) ⇒ Object
- #numbers ⇒ Object
- #vv_included? ⇒ Boolean
Instance Method Details
#capitals ⇒ Object
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 |
#letters ⇒ Object
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 |
#numbers ⇒ Object
20 21 22 |
# File 'lib/vv/string_methods.rb', line 20 def numbers ("0".."9").to_a end |
#vv_included? ⇒ Boolean
12 13 14 |
# File 'lib/vv/string_methods.rb', line 12 def vv_included? true end |