Module: Deplate::Names
- Included in:
- Command
- Defined in:
- lib/deplate/commands.rb
Overview
Description:
Usage:
TODO:
CHANGES:
Class Method Summary collapse
Class Method Details
.name_match_c(text) ⇒ Object
20 21 22 23 24 |
# File 'lib/deplate/commands.rb', line 20 def name_match_c(text) if text =~ /^\{(.*)\}$/ return {:surname => $1} end end |
.name_match_fs(text) ⇒ Object
31 32 33 34 |
# File 'lib/deplate/commands.rb', line 31 def name_match_fs(text) m = /^\s*(\S+(\s+\S+)*?)\s+(\S+)\s*$/.match(text) return m ? {:firstname => m[1], :surname => m[3]} : nil end |
.name_match_sf(text) ⇒ Object
26 27 28 29 |
# File 'lib/deplate/commands.rb', line 26 def name_match_sf(text) m = /^\s*(.+?),\s*(.+?)\s*$/.match(text) return m ? {:firstname => m[2], :surname => m[1]} : nil end |