Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/ruby_ext/string.rb
Overview
extending String with #parameterized? and #balanced_parens? only to assist macro.rb
Instance Method Summary collapse
-
#balanced_parens? ⇒ Boolean
returns whether number of open parentheses and close parentheses match.
-
#parameterized? ⇒ Boolean
returns whether or not contents include any Macro strings i.e.
Instance Method Details
#balanced_parens? ⇒ Boolean
returns whether number of open parentheses and close parentheses match
12 13 14 |
# File 'lib/ruby_ext/string.rb', line 12 def balanced_parens? self.match(/\(/).size == self.match(/\)/).size end |
#parameterized? ⇒ Boolean
returns whether or not contents include any Macro strings i.e. Parameter expressions
7 8 9 |
# File 'lib/ruby_ext/string.rb', line 7 def parameterized? self.include?('@(') end |