Class: GreenPepper::ExplicitStringType
- Defined in:
- lib/greenpepper/converter.rb
Class Method Summary collapse
Methods inherited from TypeBase
Class Method Details
.convert ⇒ Object
274 275 276 |
# File 'lib/greenpepper/converter.rb', line 274 def self.convert Proc.new{ |s| s[1..-2] } end |
.format ⇒ Object
278 279 280 281 282 283 284 285 286 |
# File 'lib/greenpepper/converter.rb', line 278 def self.format Proc.new{ |str,expected_format| if (expected_format.index("'") == 0) "'" + str.to_s + "'" else "\"" + str.to_s + "\"" end } end |
.regex ⇒ Object
270 271 272 |
# File 'lib/greenpepper/converter.rb', line 270 def self.regex /^\s*["'].*["']\s*$/ end |